actualbudget / actualbudget/actual
[Bug]: payees are created during importTransactions even if they aren't used
- 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:
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
Assessment
This issue has not been assessed yet.