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-03-11] [$250] The duplicates review page is shown when clicking the browser forward button #83532
Version Number: v9.3.26-3 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from BrowserStack:#79530 Email or phone of affected tester (no customers):applausetester+ds@applause.expensifail.com Issue reported by: Applause Internal Team Bug source: Pull Request QA execution Device used: Mac 14.5/ Chrome App Component: Money Requests
Please re-state the problem that we are trying to solve in this issue.
After resolving duplicate expenses by clicking "Keep All" on the duplicates review page, pressing the browser forward button re-opens the duplicates review page. The page should either show "Not Found" or redirect away, since the duplicates have already been resolved.
What is the root cause of that problem?
The shouldShowNotFound guard in Review.tsx (line 166) only checks whether the transaction was deleted or whether transactionID is missing:
It does not check whether the DUPLICATED_TRANSACTION violation still exists (i.e., whether there are actually duplicates to review).
When "Keep All" is clicked (line 98-108), dismissDuplicateTransactionViolation() optimistically removes the DUPLICATED_TRANSACTION violation from Onyx (Transaction.ts line 591-595), then Navigation.goBack() is called. This pushes the review page URL into the browser's forward history. When the user presses the forward button, the Review page re-renders — the transaction still exists so shouldShowNotFound is false, but duplicateTransactionIDs is now empty (the violation was removed). The page renders in a broken state with a single transaction and no actual duplicates to review.
What changes do you think we should make in order to solve the problem?
In src/pages/TransactionDuplicate/Review.tsx, extend the shouldShowNotFound condition on line 166 to also show "Not Found" when the page has loaded but there are no duplicate transaction IDs (meaning the DUPLICATED_TRANSACTION violation no longer exists):
Add a condition that checks duplicateTransactionIDs.length === 0 when the page is not loading and a transactionID exists. This way, if the user navigates forward to the review page after resolving duplicates, the page correctly shows the "Not Found" view instead of a broken review UI.
What alternative solutions did you explore? (Optional)
Adding a useEffect that calls Navigation.goBack() when duplicates are empty — This would redirect the user away, but showing the "Not Found" page is more consistent with how other resolved/deleted entity pages behave in the app.
Using history.replaceState in the keepAll navigation — This would prevent the forward history entry from existing entirely, but it would require changes to the Navigation layer and could have broader implications.
Detailed Investigation
Root Cause Analysis
The duplicate review flow works as follows:
Review.tsx reads transaction violations via useTransactionViolations hook (line 52) and extracts duplicateTransactionIDs from the DUPLICATED_TRANSACTION violation's data.duplicates array (lines 53-56)
transactionIDs combines the main transactionID with duplicateTransactionIDs (line 57)
When "Keep All" is clicked, dismissDuplicateTransactionViolation() optimistically removes the DUPLICATED_TRANSACTION violation from the TRANSACTION_VIOLATIONS Onyx collection and marks it as dismissed in transaction.comment.dismissedViolations
Navigation.goBack() navigates away
On browser forward navigation:
The page re-mounts/re-renders
transactionViolations no longer contains DUPLICATED_TRANSACTION (it was removed optimistically)
duplicateTransactionIDs becomes []
transactionIDs becomes [transactionID] (just the original transaction)
shouldShowNotFound evaluates to false because the transaction still exists
The page renders with a single transaction in the list and a working "Keep All" button — a broken state
Evidence Chain
Review.tsx:53-56 — duplicateTransactionIDs derived from DUPLICATED_TRANSACTION violation → empty after Keep All
Review.tsx:98-108 — keepAll() calls dismissDuplicateTransactionViolation() then Navigation.goBack()
Transaction.ts:591-595 — Optimistic data filters out DUPLICATED_TRANSACTION violation entirely
Review.tsx:166 — shouldShowNotFound only guards against deleted transactions, not resolved duplicates
No useEffect or useFocusEffect in Review.tsx checks for empty duplicates
Relevant Code
src/pages/TransactionDuplicate/Review.tsx:166 — The shouldShowNotFound condition (root cause)
src/pages/TransactionDuplicate/Review.tsx:53-57 — duplicateTransactionIDs and transactionIDs derivation
src/pages/TransactionDuplicate/Review.tsx:98-108 — The keepAll function
changed the title [-]The duplicates review page is shown when clicking the browser forward button[/-][+][$250] The duplicates review page is shown when clicking the browser forward button[/+]on Feb 26, 2026
🚨 Edited by proposal-police: This proposal was edited at 2026-02-26 05:22:43 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
The duplicates review page is shown when clicking the browser forward button
What is the root cause of that problem?
When "Keep All" is clicked, we uses Navigation.goBack, which pops the stack but does not remove the duplicates review URL from browser history. That leaves the page in the history, so the browser forward button can navigate back to it.
What changes do you think we should make in order to solve the problem?
In keepAll, navigate to backTo with forceReplace: true instead of Navigation.goBack, so the duplicates review entry is replaced in browser history and the forward button no longer returns to it.
What alternative solutions did you explore? (Optional)
Include "no duplicates to review" in shouldShowNotFound. So when we have a transactionID and duplicateTransactionIDs is empty (violations were dismissed), show the Not Found view.
Please re-state the problem that we are trying to solve in this issue.
The duplicates review page remains accessible after Keep All via browser forward. Should NOT show the duplicates review page (or show Not Found).
Actual Result:
Shows the duplicates review page.
What is the root cause of that problem?
The duplicates review screen does not validate that a duplicate violation still exists before rendering.
After tapping Keep All, we optimistically dismiss the duplicate violation, but the review route still remains in browser history; navigating forward reopens the route and it still renders as valid.
dismissDuplicateTransactionViolation() already removes DUPLICATED_TRANSACTION violations optimistically, so the route should become invalid once dismissal happens.
Showing Not found page when the transaction does not exist makes sense. However, it seems odd to show the Not Found page when the transaction exists. Here, when the user navigates forward to the transaction duplicate review page, there are no duplicates and, hence, no need for a review here. Maybe showing a separate page like ConfirmationPage component makes more sense here.
@MelvinBot Please include an additional alternative solution in the proposal for displaying a separate page when duplicateTransactionIDs.length === 0 e.g. a ConfirmationPage with a descriptive message, something like There are no duplicate transactions for review here.
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.30-3 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@rojiphil@laurenreidexpensify The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
Activity
melvin-bot commentedon Feb 26, 2026
Triggered auto assignment to @laurenreidexpensify (
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.MelvinBot commentedon Feb 26, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
After resolving duplicate expenses by clicking "Keep All" on the duplicates review page, pressing the browser forward button re-opens the duplicates review page. The page should either show "Not Found" or redirect away, since the duplicates have already been resolved.
What is the root cause of that problem?
The
shouldShowNotFoundguard inReview.tsx(line 166) only checks whether the transaction was deleted or whethertransactionIDis missing:It does not check whether the
DUPLICATED_TRANSACTIONviolation still exists (i.e., whether there are actually duplicates to review).When "Keep All" is clicked (line 98-108),
dismissDuplicateTransactionViolation()optimistically removes theDUPLICATED_TRANSACTIONviolation from Onyx (Transaction.ts line 591-595), thenNavigation.goBack()is called. This pushes the review page URL into the browser's forward history. When the user presses the forward button, the Review page re-renders — the transaction still exists soshouldShowNotFoundisfalse, butduplicateTransactionIDsis now empty (the violation was removed). The page renders in a broken state with a single transaction and no actual duplicates to review.What changes do you think we should make in order to solve the problem?
In
src/pages/TransactionDuplicate/Review.tsx, extend theshouldShowNotFoundcondition on line 166 to also show "Not Found" when the page has loaded but there are no duplicate transaction IDs (meaning theDUPLICATED_TRANSACTIONviolation no longer exists):Add a condition that checks
duplicateTransactionIDs.length === 0when the page is not loading and atransactionIDexists. This way, if the user navigates forward to the review page after resolving duplicates, the page correctly shows the "Not Found" view instead of a broken review UI.What alternative solutions did you explore? (Optional)
useEffectthat callsNavigation.goBack()when duplicates are empty — This would redirect the user away, but showing the "Not Found" page is more consistent with how other resolved/deleted entity pages behave in the app.history.replaceStatein thekeepAllnavigation — This would prevent the forward history entry from existing entirely, but it would require changes to the Navigation layer and could have broader implications.Detailed Investigation
Root Cause Analysis
The duplicate review flow works as follows:
Review.tsxreads transaction violations viauseTransactionViolationshook (line 52) and extractsduplicateTransactionIDsfrom theDUPLICATED_TRANSACTIONviolation'sdata.duplicatesarray (lines 53-56)transactionIDscombines the maintransactionIDwithduplicateTransactionIDs(line 57)dismissDuplicateTransactionViolation()optimistically removes theDUPLICATED_TRANSACTIONviolation from theTRANSACTION_VIOLATIONSOnyx collection and marks it as dismissed intransaction.comment.dismissedViolationsNavigation.goBack()navigates awayOn browser forward navigation:
transactionViolationsno longer containsDUPLICATED_TRANSACTION(it was removed optimistically)duplicateTransactionIDsbecomes[]transactionIDsbecomes[transactionID](just the original transaction)shouldShowNotFoundevaluates tofalsebecause the transaction still existsEvidence Chain
Review.tsx:53-56—duplicateTransactionIDsderived fromDUPLICATED_TRANSACTIONviolation → empty after Keep AllReview.tsx:98-108—keepAll()callsdismissDuplicateTransactionViolation()thenNavigation.goBack()Transaction.ts:591-595— Optimistic data filters outDUPLICATED_TRANSACTIONviolation entirelyReview.tsx:166—shouldShowNotFoundonly guards against deleted transactions, not resolved duplicatesuseEffectoruseFocusEffectin Review.tsx checks for empty duplicatesRelevant Code
src/pages/TransactionDuplicate/Review.tsx:166— TheshouldShowNotFoundcondition (root cause)src/pages/TransactionDuplicate/Review.tsx:53-57—duplicateTransactionIDsandtransactionIDsderivationsrc/pages/TransactionDuplicate/Review.tsx:98-108— ThekeepAllfunctionsrc/libs/actions/Transaction.ts:591-595— Optimistic violation removalsrc/hooks/useTransactionViolations.ts:17-26— Violation filtering hookNext Steps for Contributor+ team: Reply with
@MelvinBot implement thisto create a draft PR, or@MelvinBot <your feedback>to refine this analysis.melvin-bot commentedon Feb 26, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @rojiphil (
External)melvin-bot commentedon Feb 26, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022026887611542236135
[-]The duplicates review page is shown when clicking the browser forward button[/-][+][$250] The duplicates review page is shown when clicking the browser forward button[/+]ryntgh commentedon Feb 26, 2026
🚨 Edited by proposal-police: This proposal was edited at 2026-02-26 05:22:43 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
The duplicates review page is shown when clicking the browser forward button
What is the root cause of that problem?
When "Keep All" is clicked, we uses
Navigation.goBack, which pops the stack but does not remove the duplicates review URL from browser history. That leaves the page in the history, so the browser forward button can navigate back to it.App/src/pages/TransactionDuplicate/Review.tsx
Lines 97 to 106 in 6b64304
What changes do you think we should make in order to solve the problem?
In
keepAll, navigate tobackTowithforceReplace: trueinstead ofNavigation.goBack, so the duplicates review entry is replaced in browser history and the forward button no longer returns to it.App/src/pages/TransactionDuplicate/Review.tsx
Lines 97 to 106 in 6b64304
What alternative solutions did you explore? (Optional)
Include "no duplicates to review" in
shouldShowNotFound. So when we have atransactionIDandduplicateTransactionIDsis empty (violations were dismissed), show the Not Found view.App/src/pages/TransactionDuplicate/Review.tsx
Line 166 in 6b64304
We should update the
shouldShowNotFoundcondition for another duplicate review page as well (ReviewBillable,ReviewCategory,Confirmation, etc)App/src/pages/TransactionDuplicate/Confirmation.tsx
Line 50 in 6b64304
App/src/pages/TransactionDuplicate/Confirmation.tsx
Lines 114 to 118 in 6b64304
abbasifaizan70 commentedon Feb 26, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
The duplicates review page remains accessible after Keep All via browser forward. Should NOT show the duplicates review page (or show Not Found).
Actual Result:
Shows the duplicates review page.
What is the root cause of that problem?
The duplicates review screen does not validate that a duplicate violation still exists before rendering.
After tapping Keep All, we optimistically dismiss the duplicate violation, but the review route still remains in browser history; navigating forward reopens the route and it still renders as valid.
App/src/pages/TransactionDuplicate/Review.tsx
Lines 98 to 108 in a152afa
App/src/pages/TransactionDuplicate/Review.tsx
Lines 165 to 167 in a152afa
dismissDuplicateTransactionViolation()already removesDUPLICATED_TRANSACTIONviolations optimistically, so the route should become invalid once dismissal happens.App/src/libs/actions/Transaction.ts
Lines 591 to 595 in a152afa
What changes do you think we should make in order to solve the problem?
Demo
Screen.Recording.2026-02-26.at.12.26.01.PM.mov
rojiphil commentedon Feb 27, 2026
Showing
Not foundpage when the transaction does not exist makes sense. However, it seems odd to show theNot Foundpage when the transaction exists. Here, when the user navigates forward to the transaction duplicate review page, there are no duplicates and, hence, no need for a review here. Maybe showing a separate page likeConfirmationPagecomponent makes more sense here.App/src/components/ConfirmationPage.tsx
Line 74 in 651201c
@MelvinBot Please include an additional alternative solution in the proposal for displaying a separate page when
duplicateTransactionIDs.length === 0e.g. aConfirmationPagewith a descriptive message, something likeThere are no duplicate transactions for review here.16 remaining items
melvin-bot commentedon Mar 4, 2026
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Mar 4, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.30-3 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2026-03-11. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Mar 4, 2026
@rojiphil @laurenreidexpensify The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
melvin-bot commentedon Mar 5, 2026
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
laurenreidexpensify commentedon Mar 11, 2026
Payment Summary
quinthar commentedon Apr 13, 2026
Approved $250 to @rojiphil