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

Closed
opened 2026-02-28 19:29:12 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @jacopo-j on GitHub (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

Originally created by @jacopo-j on GitHub (Apr 6, 2024). ### Verified issue does not already exist? - [X] I have searched and found no existing issue - [X] 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_id`s, Actual's deduplication function merges the two transactions even if it should not. As an example, I imported the following transaction: ```json { "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: ```json { "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`): ```json { "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_id`s into account, while it should to avoid unintentionally merging different transactions. This issue was previously discussed on [Discord](https://discord.com/channels/937901803608096828/1226164998871580782). ### Where are you hosting Actual? Docker ### What browsers are you seeing the problem on? Firefox ### Operating System Mac OSX
GiteaMirror added the transaction importbug labels 2026-02-28 19:29:12 -06:00
Author
Owner

@ttlgeek commented on GitHub (Apr 15, 2024):

Currently investigating this

@ttlgeek commented on GitHub (Apr 15, 2024): Currently investigating this
Author
Owner

@ttlgeek commented on GitHub (Apr 17, 2024):

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

@ttlgeek commented on GitHub (Apr 17, 2024): @jacopo-j Check Matiss' comment on this PR #2618
Author
Owner

@MatissJanis commented on GitHub (Jun 22, 2024):

Patch was rolled back.

@MatissJanis commented on GitHub (Jun 22, 2024): Patch was rolled back.
Author
Owner

@pmoon00 commented on GitHub (Jul 14, 2024):

@MatissJanis Is there someone else I could tag to review the PR to address this issue?

@pmoon00 commented on GitHub (Jul 14, 2024): @MatissJanis Is there someone else I could tag to review the PR to address this issue?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#1028