You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Due for payment 2026-05-07] [$250] Duplicate - "Potential Duplicate" error displayed despite editing amount on one expense #67116
Tap on "Add Expense" on the just created report and create an expense similar to the previous one.
Open the first created expense.
Tap on the "Amount" field and edit the amount.
Return to chat.
Note that "Potential duplicate" error appears on the expense that wasn´t edited.
Navigate to "Inbox"
Note that a RBR is displayed on workspace chat.
Reopen workspace chat and open report of the expense with the "Potential Duplicate" error.
Note that the error is cleared.
Expected Result:
After editing the amount on one of the duplicate expenses, the "Potential Duplicate" error shouldn´t appear on the remaining expense.
Actual Result:
When creating two similar expenses and editing the amount on one of them, the "Potential Duplicate" error, appears on the expense that wasn´t edited, despite amounts being different. Error is cleared after opening and closing the expense report. Issue is reproducible while online and also if the first expense is edited while offline.
Please re-state the problem that we are trying to solve in this issue.
Duplicate - "Potential Duplicate" error displayed despite editing amount on one expense
What is the root cause of that problem?
When the amount of an expense is updated, we do not re-evaluate or remove the "Potential Duplicate" violation. This logic is missing in the violation update flow:
As a result, the violation persists on the related expense even when the condition causing the duplication no longer exists.
What changes do you think we should make in order to solve the problem?
We should enhance the logic to detect when the duplicate condition is resolved (e.g., amount is modified), and proactively remove the DUPLICATED_TRANSACTION violation from all involved transactions. This can be done by inserting the following block just below this line:
In addition to amount updates, this logic can be generalized to apply when editing other fields (e.g., currency or merchant) that could invalidate the duplication. We just need to ensure that the condition for resolving the duplicate is met before triggering the violation cleanup.
Also, we can update snapshot data if needed, similar to what’s done here:
changed the title [-]Duplicate - "Potential Duplicate" error displayed despite editing amount on one expense[/-][+][$250] Duplicate - "Potential Duplicate" error displayed despite editing amount on one expense[/+]on Jul 30, 2025
Activity
melvin-bot commentedon Jul 24, 2025
Triggered auto assignment to @JmillsExpensify (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.thelullabyy commentedon Jul 26, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
Duplicate - "Potential Duplicate" error displayed despite editing amount on one expense
What is the root cause of that problem?
When the amount of an expense is updated, we do not re-evaluate or remove the "Potential Duplicate" violation. This logic is missing in the violation update flow:
App/src/libs/actions/IOU.ts
Lines 4322 to 4332 in 4b68aa8
As a result, the violation persists on the related expense even when the condition causing the duplication no longer exists.
What changes do you think we should make in order to solve the problem?
We should enhance the logic to detect when the duplicate condition is resolved (e.g., amount is modified), and proactively remove the
DUPLICATED_TRANSACTIONviolation from all involved transactions. This can be done by inserting the following block just below this line:App/src/libs/actions/IOU.ts
Lines 4332 to 4337 in 4b68aa8
In addition to amount updates, this logic can be generalized to apply when editing other fields (e.g., currency or merchant) that could invalidate the duplication. We just need to ensure that the condition for resolving the duplicate is met before triggering the violation cleanup.
Also, we can update snapshot data if needed, similar to what’s done here:
App/src/libs/actions/IOU.ts
Line 4338 in 4b68aa8
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
NA
What alternative solutions did you explore? (Optional)
JmillsExpensify commentedon Jul 30, 2025
Opening up to the community.
[-]Duplicate - "Potential Duplicate" error displayed despite editing amount on one expense[/-][+][$250] Duplicate - "Potential Duplicate" error displayed despite editing amount on one expense[/+]melvin-bot commentedon Jul 30, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021950476273513163048
157 remaining items
mallenexpensify commentedon May 8, 2026
Payment Summary
Contributor: @thelullabyy paid $250 via Upwork
Contributor+: @aimane-chnaif paid $250 via Upwork
@aimane-chnaif can you please accept the job below? Please reply here and tag me once you have.
https://www.upwork.com/jobs/~022052881588618217743
@aimane-chnaif if jobs are offered in Upwork, please accept them. It's a pain to have to create new jobs (basing this of the below).
^ Test case created
aimane-chnaif commentedon May 15, 2026
@mallenexpensify accepted offer
mallenexpensify commentedon May 16, 2026
@aimane-chnaif paid, summary updated above. Thx.