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-07-23] Expense - "Discard Changes" modal not displayed after editing waypoints in distance expense. #94910
Version Number: 9.4.24-0 Reproducible in staging?: Yes Reproducible in production?: N/A - new feature, doesn't exist in prod If this was caught during regression testing, add the test name, ID and link from BrowserStack:#93268 Email or phone of affected tester (no customers):ibellicotest+2766@gmail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Motorola MotoG60 / Android 12 (Hybrid app) - Windows 11 / Chrome App Component: Money Requests
Action Performed:
Open the staging.new.expensify.com website.
Click on FAB > "Track Distance" > "Map"
Enter waypoints.
Click on tab´s back button or browser´s back button.
Note that "Discard Changes" modal is displayed.
Dismiss modal and click on "Next"
On confirm page, click on "Distance" field.
Edit any waypoint.
Click on tab´s back button or browser´s back button.
Note that you return to confirm details page and changes are automatically discarded.
Expected Result:
"Discard Changes" modal should be displayed when clicking on back button after editing waypoints on a distance expense.
Actual Result:
"Discard Changes" modal is not displayed after editing waypoints on a distance expense and clicking on back button. User is redirected to previous page and changes are automatically discarded.
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
Identify the pull request that introduced this issue and revert it.
Please re-state the problem that we are trying to solve in this issue.
The "Discard changes" modal does not appear when you edit a waypoint from the confirmation page of a distance expense (via the Distance field) and press back. The waypoint edit is silently discarded with no warning. The modal does correctly appear when entering waypoints during the initial create flow.
What is the root cause of that problem?
PR #93268 registered the discard guard with a dirty‑check that is hard‑gated on isCreatingNewRequest:
When you open the distance step from the confirmation page's Distance field, it always passes Navigation.getActiveRoute() as backTo — DistanceField.tsx:70. So isCreatingNewRequest becomes false, getHasUnsavedChanges() always returns false, the guard never calls preventDefault, and back navigation proceeds without the modal.
Why the create flow works but the edit‑from‑confirm flow doesn't
Create flow: no backTo, action !== EDIT → isCreatingNewRequest = true → doesMoneyRequestDraftHaveUserInput(transaction) runs and the modal fires.
Edit‑from‑confirm flow:backTo is set → isCreatingNewRequest = false → dirty‑check short‑circuits to false → no modal, changes discarded.
Note this entry point does not render in isEditing mode (action is still create/submit, not EDIT); the isEditing branch is for the report‑thread edit entry. So the only thing disabling the guard here is the isCreatingNewRequest gate.
doesMoneyRequestDraftHaveUserInput (TransactionUtils/index.ts:1256-1262) only counts draft waypoints; it does not diff against a saved baseline, which is why it isn't suitable for the edit case as‑is.
What changes do you think we should make in order to solve the problem?
Make getHasUnsavedChanges cover the edit‑from‑confirm entry point instead of being unconditionally disabled by isCreatingNewRequest. When backTo is set (editing an in‑progress request from confirm), "dirty" should be a comparison of the current draft waypoints against the pre‑edit baseline, reusing the change‑detection already present in submitWaypoints — haveWaypointAddressesChanged(transactionBackup?.comment?.waypoints, waypoints) (IOURequestStepDistance.tsx:464-466).
(Excluding the isEditing report‑thread entry if that path is intentionally handled elsewhere.)
What alternative solutions did you explore?
Reverting PR #93268 would remove the regression but also remove the new (working) back‑button discard guard for the create flow, so a targeted fix to the dirty‑check is preferred.
Next Steps for Contributor+ team: To accept:@MelvinBot implement [this](https://github.com/Expensify/App/issues/94910) to create a draft PR. To refine:@MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.
changed the title [-]Expense - "Discard Changes" modal not displayed after editing waypoints in distance expense.[/-][+][Due for payment 2026-07-23] Expense - "Discard Changes" modal not displayed after editing waypoints in distance expense.[/+]on Jul 16, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.34-14 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@MonilBhavsar@TaduJR 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]. If no checklist is needed for this issue, you can click: [no checklist button]
Activity
applause-bot commentedon Jun 29, 2026
While Applause doesn't embed attachments for this bug, here are the links for quick view:
https://platform.applause.com/services/links/v1/external/bf458e476d1aef3baaadf5592f3c7a26322a5e945cf5ac39e0f9096442cbcbdd
melvin-bot commentedon Jun 29, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #93268
melvin-bot commentedon Jun 29, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon Jun 29, 2026
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
MelvinBot commentedon Jun 29, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
The "Discard changes" modal does not appear when you edit a waypoint from the confirmation page of a distance expense (via the Distance field) and press back. The waypoint edit is silently discarded with no warning. The modal does correctly appear when entering waypoints during the initial create flow.
What is the root cause of that problem?
PR #93268 registered the discard guard with a dirty‑check that is hard‑gated on
isCreatingNewRequest:IOURequestStepDistance.tsx:159-161isCreatingNewRequestis false whenever abackToparam is present —IOURequestStepDistance.tsx:152:When you open the distance step from the confirmation page's Distance field, it always passes
Navigation.getActiveRoute()asbackTo—DistanceField.tsx:70. SoisCreatingNewRequestbecomesfalse,getHasUnsavedChanges()always returnsfalse, the guard never callspreventDefault, and back navigation proceeds without the modal.Why the create flow works but the edit‑from‑confirm flow doesn't
backTo,action !== EDIT→isCreatingNewRequest = true→doesMoneyRequestDraftHaveUserInput(transaction)runs and the modal fires.backTois set →isCreatingNewRequest = false→ dirty‑check short‑circuits tofalse→ no modal, changes discarded.isEditingmode (actionis stillcreate/submit, notEDIT); theisEditingbranch is for the report‑thread edit entry. So the only thing disabling the guard here is theisCreatingNewRequestgate.doesMoneyRequestDraftHaveUserInput(TransactionUtils/index.ts:1256-1262) only counts draft waypoints; it does not diff against a saved baseline, which is why it isn't suitable for the edit case as‑is.What changes do you think we should make in order to solve the problem?
Make
getHasUnsavedChangescover the edit‑from‑confirm entry point instead of being unconditionally disabled byisCreatingNewRequest. WhenbackTois set (editing an in‑progress request from confirm), "dirty" should be a comparison of the current draft waypoints against the pre‑edit baseline, reusing the change‑detection already present insubmitWaypoints—haveWaypointAddressesChanged(transactionBackup?.comment?.waypoints, waypoints)(IOURequestStepDistance.tsx:464-466).Roughly:
(Excluding the
isEditingreport‑thread entry if that path is intentionally handled elsewhere.)What alternative solutions did you explore?
Reverting PR #93268 would remove the regression but also remove the new (working) back‑button discard guard for the create flow, so a targeted fix to the dirty‑check is preferred.
Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/94910)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
TaduJR commentedon Jun 29, 2026
👋
10 remaining items
[-]Expense - "Discard Changes" modal not displayed after editing waypoints in distance expense.[/-][+][Due for payment 2026-07-23] Expense - "Discard Changes" modal not displayed after editing waypoints in distance expense.[/+]melvin-bot commentedon Jul 16, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.34-14 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-07-23. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Jul 16, 2026
@MonilBhavsar @TaduJR 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]. If no checklist is needed for this issue, you can click: [no checklist button]
melvin-bot commentedon Jul 21, 2026
@TaduJR Eep! 4 days overdue now. Issues have feelings too...
melvin-bot commentedon Jul 22, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)melvin-bot commentedon Jul 22, 2026
Payment Summary
Upwork Job
BugZero Checklist (@mallenexpensify)
mallenexpensify commentedon Jul 24, 2026
Assuming this isn't due payment cuz it came from
Comment if you disagree
(reminder to cancel upwork job, if not due payment)
TaduJR commentedon Jul 24, 2026
We can close this
cc @MonilBhavsar
MonilBhavsar commentedon Jul 24, 2026
Thanks 👍