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-18] [Due for payment 2026-05-15] Distance - Edited distance reverts to default distance after submitting distance from self DM #89847
Version Number: 9.3.68-0 Reproducible in staging?: Yes Reproducible in production?: No If this was caught during regression testing, add the test name, ID and link from BrowserStack:#85493 Email or phone of affected tester (no customers):josdjnosdjionjsdonjisod@gmail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Mac 26.2 / Chrome App Component: Money Requests
Action Performed:
Go to staging.new.expensify.com
Go to workspace chat.
Create a map distance expense.
Open the expense.
Click Distance.
Go to Manual tab.
Edit the distance and save it.
Click Report field > Remove from report.
Go to self DM.
Open the distance expense.
Click on the header > Submit it to someone.
Select workspace chat.
→ Confirm page shows the edited distance from Step 7.
Click Create expense.
Open the expense.
Expected Result:
The edited distance will persist after submitting the distance expense from self DM.
Actual Result:
The edited distance reverts to default distance after submitting the distance expense from self DM.
👋 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.
Classification: Frontend bug Causing PR: #85493 - "Allowing distance to be edited while editing" by @mukhrr (High confidence) Related Issues: #83781 (the original issue this PR fixed)
Recommendation: REVERT
This PR introduced a regression in the distance editing flow. The edited distance reverts to the default route-calculated distance after the expense is removed from a report and re-submitted from the self DM. The fix requires changes to the App codebase, and the causing PR is clearly identifiable.
Assigned: @mukhrr (PR author), @aimane-chnaif and @youssef-lr (approving reviewers) Labels: DeployBlockerCash kept (Frontend bug — App PR is the cause). DeployBlocker should be removed (no backend fix needed).
The PR made several changes to the distance backup/restore and submit flow that interact in a way that causes the regression:
TransactionEdit.ts: The createBackupTransaction function was changed to check transactionBackup?.transactionID instead of just transactionBackup. This was intended to prevent "corrupted" partial-route backups from being restored. However, if the transaction backup legitimately lacks a transactionID field (e.g., during the "remove from report" flow where Onyx state may be partially updated), the backup check would fall through, overwriting the backup with the current (pre-edit) state instead of preserving the user's manual edit.
IOURequestStepDistance.tsx: The navigation after save was changed from navigateBack() to navigateBackAfterSave() which calls Navigation.closeRHPFlow(). The removeBackupTransaction is now called eagerly before navigation completes. When the user removes the expense from a report and navigates to self DM, the sequence of backup creation and restoration may differ from the original flow, resulting in the original route-calculated distance being used rather than the manually saved value.
UpdateMoneyRequest.ts: The logic for when to clear routes from the success data was made conditional. For pure distance edits (shouldClearRoutes = false), the routes are kept — but routes.route0.distance still holds the original map-calculated distance. Since getDistanceInMeters now prioritizes comment.customUnit.quantity over routes.route0.distance, the saved quantity should win. However, when the distance edit path is taken through the re-submission from self DM, the transaction data that reaches getUpdatedTransaction may not have the manually-edited quantity value if the backup was incorrectly restored.
The interaction between these three changes produces the observed regression where the edited distance is lost after "Remove from report" + re-submit.
Here we need BE fix too. Just leaving comment her not to lose later:
Title: AddTrackedExpenseToPolicy should honor distance param when present
Issue: When converting a tracked distance expense to a workspace expense via AddTrackedExpenseToPolicy, the BE recomputes the distance from waypoints and ignores the explicit distance param sent in the request. This drops the user's manually-edited distance.
Repro:
Workspace chat → create a manual distance expense (e.g. 81 mi route)
Open expense → Distance → Manual tab → edit to 100 mi → Save
Remove from report → expense moves to self DM
Self DM → header → "Submit it to someone" → select workspace → Create
Expected: The new workspace expense persists at 100 mi. Actual: Optimistically shows 100 mi, then reverts to 81 mi (BE-recomputed from waypoints) after the request settles.
Ask: When distance is present alongside waypoints in AddTrackedExpenseToPolicy, persist the explicit distance value as customUnit.quantity instead of recomputing it from waypoints. This matches the behavior of UpdateMoneyRequestDistance, which already honors the explicit distance param.
Context: The FE fix landed in PR — it now sends the manually-edited distance through the convert flow. BE alignment is the last piece to make the manual edit fully persist across self-DM → workspace conversion.
changed the title [-]Distance - Edited distance reverts to default distance after submitting distance from self DM[/-][+][Due for payment 2026-05-15] Distance - Edited distance reverts to default distance after submitting distance from self DM[/+]on May 8, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.68-3 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@aimane-chnaif 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]
changed the title [-][Due for payment 2026-05-15] Distance - Edited distance reverts to default distance after submitting distance from self DM[/-][+][Due for payment 2026-05-18] [Due for payment 2026-05-15] Distance - Edited distance reverts to default distance after submitting distance from self DM[/+]on May 11, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.69-18 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@aimane-chnaif 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 May 7, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #85493
melvin-bot commentedon May 7, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon May 7, 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:
OSBotify commentedon May 7, 2026
Investigation Summary
Classification: Frontend bug
Causing PR: #85493 - "Allowing distance to be edited while editing" by @mukhrr (High confidence)
Related Issues: #83781 (the original issue this PR fixed)
Recommendation: REVERT
This PR introduced a regression in the distance editing flow. The edited distance reverts to the default route-calculated distance after the expense is removed from a report and re-submitted from the self DM. The fix requires changes to the App codebase, and the causing PR is clearly identifiable.
Assigned: @mukhrr (PR author), @aimane-chnaif and @youssef-lr (approving reviewers)
Labels:
DeployBlockerCashkept (Frontend bug — App PR is the cause).DeployBlockershould be removed (no backend fix needed).Detailed Analysis
Evidence
9.3.68-0.Verification
Files affected by the bug:
src/libs/actions/TransactionEdit.ts— backup/restore transaction logicsrc/libs/actions/IOU/UpdateMoneyRequest.ts— distance update and optimistic datasrc/libs/TransactionUtils/index.ts—getUpdatedTransactiondistance branchsrc/pages/iou/request/step/IOURequestStepDistance.tsx— distance step navigation and submitPR #85493 modifies all four of these files.
Root Cause
The PR made several changes to the distance backup/restore and submit flow that interact in a way that causes the regression:
TransactionEdit.ts: ThecreateBackupTransactionfunction was changed to checktransactionBackup?.transactionIDinstead of justtransactionBackup. This was intended to prevent "corrupted" partial-route backups from being restored. However, if the transaction backup legitimately lacks atransactionIDfield (e.g., during the "remove from report" flow where Onyx state may be partially updated), the backup check would fall through, overwriting the backup with the current (pre-edit) state instead of preserving the user's manual edit.IOURequestStepDistance.tsx: The navigation after save was changed fromnavigateBack()tonavigateBackAfterSave()which callsNavigation.closeRHPFlow(). TheremoveBackupTransactionis now called eagerly before navigation completes. When the user removes the expense from a report and navigates to self DM, the sequence of backup creation and restoration may differ from the original flow, resulting in the original route-calculated distance being used rather than the manually saved value.UpdateMoneyRequest.ts: The logic for when to clearroutesfrom the success data was made conditional. For pure distance edits (shouldClearRoutes = false), the routes are kept — butroutes.route0.distancestill holds the original map-calculated distance. SincegetDistanceInMetersnow prioritizescomment.customUnit.quantityoverroutes.route0.distance, the saved quantity should win. However, when the distance edit path is taken through the re-submission from self DM, the transaction data that reachesgetUpdatedTransactionmay not have the manually-editedquantityvalue if the backup was incorrectly restored.The interaction between these three changes produces the observed regression where the edited distance is lost after "Remove from report" + re-submit.
2 remaining items
francoisl commentedon May 7, 2026
PR was reverted, going to close as the steps are no longer relevant.
mukhrr commentedon May 7, 2026
Here we need BE fix too. Just leaving comment her not to lose later:
Title:
AddTrackedExpenseToPolicyshould honordistanceparam when presentIssue: When converting a tracked distance expense to a workspace expense via
AddTrackedExpenseToPolicy, the BE recomputes the distance fromwaypointsand ignores the explicitdistanceparam sent in the request. This drops the user's manually-edited distance.Repro:
Expected: The new workspace expense persists at 100 mi.
Actual: Optimistically shows 100 mi, then reverts to 81 mi (BE-recomputed from waypoints) after the request settles.
Payload sent (relevant fields):
Ask: When
distanceis present alongsidewaypointsinAddTrackedExpenseToPolicy, persist the explicitdistancevalue ascustomUnit.quantityinstead of recomputing it from waypoints. This matches the behavior ofUpdateMoneyRequestDistance, which already honors the explicitdistanceparam.Context: The FE fix landed in PR — it now sends the manually-edited distance through the convert flow. BE alignment is the last piece to make the manual edit fully persist across self-DM → workspace conversion.
[-]Distance - Edited distance reverts to default distance after submitting distance from self DM[/-][+][Due for payment 2026-05-15] Distance - Edited distance reverts to default distance after submitting distance from self DM[/+]melvin-bot commentedon May 8, 2026
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon May 8, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.68-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-05-15. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon May 8, 2026
@aimane-chnaif 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]
[-][Due for payment 2026-05-15] Distance - Edited distance reverts to default distance after submitting distance from self DM[/-][+][Due for payment 2026-05-18] [Due for payment 2026-05-15] Distance - Edited distance reverts to default distance after submitting distance from self DM[/+]melvin-bot commentedon May 11, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.69-18 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-05-18. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon May 11, 2026
@aimane-chnaif 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]