Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Transaction deduplication happens even if transactions have different imported_ids #2562

Open
2 tasks done
jacopo-j opened this issue Apr 6, 2024 · 2 comments · May be fixed by #2770
Open
2 tasks done

[Bug]: Transaction deduplication happens even if transactions have different imported_ids #2562

jacopo-j opened this issue Apr 6, 2024 · 2 comments · May be fixed by #2770
Labels
bug Something isn't working help wanted Extra attention is needed transaction import Related to manually importing transactions

Comments

@jacopo-j
Copy link

jacopo-j commented Apr 6, 2024

Verified issue does not already exist?

  • I have searched and found no existing issue
  • I will be providing steps how to reproduce the bug (in most cases this will also mean uploading a demo budget file)

What happened?

I'm using a custom script to add transaction to Actual. The script uses the importTransactions function of the actual API. If I import two "similar" transactions, albeit with different import_ids, Actual's deduplication function merges the two transactions even if it should not.

As an example, I imported the following transaction:

{
    "account": "73157c52-9179-4d3b-85c1-01dd5db1cf28",
    "date": "2024-04-05",
    "amount": -1239,
    "imported_payee": "Acme Inc.",
    "payee_name": "Acme Inc.",
    "imported_id": "b85cdd57-5a1c-4ca5-bd54-12e5b56fa02c",
    "notes": "TEST TRANSACTION",
    "cleared": true
}

Import was successful and the transaction appeared on Actual. Then, I imported the following transaction, which differs in date and imported_id, but has the same amount and other properties of the previous one:

{
    "account": "73157c52-9179-4d3b-85c1-01dd5db1cf28",
    "date": "2024-04-06",
    "amount": -1239,
    "imported_payee": "Acme Inc.",
    "payee_name": "Acme Inc.",
    "imported_id": "ca1589b2-7bc3-4587-a157-476170b383a7",
    "notes": "TEST TRANSACTION",
    "cleared": true
}

The second import was also successful, but the transaction did not get added to Actual. Instead, the date of the first transaction got updated to match the second one (or the second transaction was added and the first disappeared, depending on how you want to see it).

As a sanity check, I changed the amount and tried importing the transaction again (with a fresh imported_id):

{
    "account": "73157c52-9179-4d3b-85c1-01dd5db1cf28",
    "date": "2024-04-06",
    "amount": -9876,
    "imported_payee": "Acme Inc.",
    "payee_name": "Acme Inc.",
    "imported_id": "3497767b-3d28-4887-bb9d-80fb7f113d4e",
    "notes": "TEST TRANSACTION",
    "cleared": true
}

This time, a separate transaction was added to Actual.

This behavior suggests that the deduplication feature does not take different imported_ids into account, while it should to avoid unintentionally merging different transactions.

This issue was previously discussed on Discord.

Where are you hosting Actual?

Docker

What browsers are you seeing the problem on?

Firefox

Operating System

Mac OSX

@jacopo-j jacopo-j added the bug Something isn't working label Apr 6, 2024
@MatissJanis MatissJanis added help wanted Extra attention is needed transaction import Related to manually importing transactions labels Apr 7, 2024
@ttlgeek
Copy link
Contributor

ttlgeek commented Apr 15, 2024

Currently investigating this

ttlgeek added a commit to ttlgeek/actual that referenced this issue Apr 16, 2024
@ttlgeek
Copy link
Contributor

ttlgeek commented Apr 17, 2024

@jacopo-j Check Matiss' comment on this PR #2618

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed transaction import Related to manually importing transactions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants