Repository navigation
Only dismiss the duplicate violation on expenses that have it - #106997
Conversation
Keep all wrote the optimistic duplicatedTransaction dismissal to every transaction in the review. The server stores it only for the ones that carry the violation, so the other transaction kept a local-only dismissal that hid the violation when it was raised on it later, for example after unapproving a paid report.
|
@gijoe0295 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@mollfpr I am curios if it's expected behavior or not.
As you see, after retracting on step 6, we see "Potential duplicate" error message and Review duplicates button on previously paid, but then retracted expense report. But we see neither in the first report. so is this expected ? cc @gijoe0295 |
|
Also I found a clear bug with these steps:
staging.bug.mp4@mollfpr do you think we should have another follow up for this? |
|
@mukhrr yes, the first behavior is expected. The server skips duplicate dismissal for transactions on approved or reimbursed reports, so the paid expense never gets the dismissal. After retract, the server raises the violation again on that expense only. The draft expense keeps its dismissal, so it stays clean. The second one is a real bug, and it has the same cause. We also add the optimistic "resolved the duplicate" action for the paid expense, but the server never creates it, so it seems disappears when we go online. I think we should fix in here by only adding that action for transactions that have the violation. |
…lation Keep all added the optimistic "resolved the duplicate" report action to every transaction in the review. The server only adds one to the transactions that carry the violation, so on the others the comment showed while offline and disappeared once the request succeeded.
thanks Mohammad) |
|
@mollfpr am I right that this PR wants to show the duplicate error message again on an expense that already had it resolved, then went to paid and back? Or am I misinterpreting the steps? |
|
@dylanexpensify no, not quite. The paid expense never had the duplicate resolved. In the steps we press "Keep all" on the new expense only. The server skips the dismissal for expenses on approved or paid reports, so the paid expense keeps the violation. After we retract, the server raises it again on that expense. This PR does not change that. The PR only fixes the local (optimistic) data. Before, "Keep all" also wrote a dismissal and a "resolved the duplicate" comment on the paid expense, even though the server never saves them. Now we write them only on expenses that have the violation. So the comment no longer disappears when the request finishes. |
dylanexpensify
left a comment
There was a problem hiding this comment.
Looks good from a product perspective 👍
|
Got it, so the write only occurs for expenses w/violation now, not on approved/paid ones? |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2026-11-22.at.00.55.24.movAndroid: mWeb ChromeScreen.Recording.2026-11-21.at.23.33.48.moviOS: HybridAppScreen.Recording.2026-11-22.at.00.41.50.moviOS: mWeb SafariScreen.Recording.2026-11-22.at.00.41.50.movMacOS: Chrome / SafariScreen.Recording.2026-11-21.at.22.30.24.mov |
|
@mukhrr Please resolve the conflict |
# Conflicts: # tests/unit/TransactionTest.ts
|
@gijoe0295 done |
|
LGTM! |
mollfpr
left a comment
There was a problem hiding this comment.
Looks good to me! Thanks!
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 mollfpr has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/mollfpr in version: 9.5.53-0 🚀
|
|
No help site update needed — this PR fixes local duplicate-dismissal data to match existing server behavior, without adding a feature, changing the workflow, or making an existing article factually incorrect. |
|
🚀 Deployed to production by https://github.com/arosiclair in version: 9.5.53-3 🚀
Bundle Size Analysis (Sentry): |

Explanation of Change
Keep all wrote the duplicate dismissal and the "resolved the duplicate" comment to every expense in the review, but the server keeps them only for expenses with the violation, so on the others the local dismissal later hid the violation once it was raised and the comment disappeared after the request succeeded. Both are now written only to expenses that have the duplicate violation.
Fixed Issues
$ #106975
PROPOSAL:
Tests
Precondition: a workspace with approvals enabled where you are both the submitter and the approver.
Offline tests
QA Steps
Same as tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged theExpensify/designteam so the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
106975-after-android.mp4
Android: mWeb Chrome
android.mweb.mp4
iOS: Native
ios.app.mp4
iOS: mWeb Safari
ios.mweb.mp4
MacOS: Chrome / Safari
106975-after-web.mp4