actualbudget / actualbudget/actual

[Bug]: payees are created during importTransactions even if they aren't used

Open
#8,855 0 comments 0 reactions 0 assignees View on GitHub
needs triage
Dominant language
TypeScript
Stars
28.7k
Forks
3k
Avg merge
2d 11h
Merged PRs (30d)
65

Description

### What happened?

I use a script to import transactions from my banks. I have rules that automatically attribute payees based on bank label. Say I have an operation with bank label "FOOBAR" and a rule that sets the payee to "FooBar, Inc".

Every time I'll run my scripts, it'll send the operation with `imported_payee: "FOOBAR"` to `importTransactions` which will perform the eventual matching, and then apply the rules.

If the operation didn't exist, then a "FOOBAR" payee is created and the operation is associated to it. The rules are then applied, and that payee rightly becomes unused. **This is not a problem, per se. It's easy to delete those from the UI. It would be a QoL feature to automatically delete payees that were created during the import, but this is not the bug.**

However, if the operation did exist, based on the `imported_id` (which is most of the time, since the import will send all the data to Actual), then that "FOOBAR" payee is still created, even though there's nothing to update.

My DB ends up looking like this:

Image

Of course, I can force clearing the tombstone by resetting sync. But then I have to do that every few months otherwise my `payees` table fills with thousands of entries, etc.

### How can we reproduce the issue?

See description.

### Where are you hosting Actual?

Docker

### What browsers are you seeing the problem on?

_No response_

### Operating System

None

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.