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-04-14] [Due for payment 2026-03-13] [$250] Distance - To field changes from workspace to self DM after changing rate and submitting it #83955
Version Number: 9.3.28-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:#81883 Email or phone of affected tester (no customers):isodjnosidjiojiojiso@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:
Precondition:
Workspace has at least two distance rates.
Go to staging.new.expensify.com
Go to self DM.
Create a manual distance expense.
Open the expense.
Go offline.
Click Rate and select another rate.
Go back to self DM.
Click Submit it to someone.
Select workspace chat.
On confirm page, go online.
Expected Result:
To field on confirm page will not change after returning online.
Actual Result:
To field on confirm page changes to self DM.
Amount is flipped.
👋 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.
When a user creates a manual distance expense in self-DM, opens it, goes offline, changes the rate, then initiates "Submit it to someone" and selects a workspace, the "To" field on the confirm page reverts from the selected workspace to self-DM when the user goes back online. The amount also flips sign.
What is the root cause of that problem?
The root cause is in getUpdateTrackExpenseParams (src/libs/actions/IOU/index.ts:5120-5126). When updating a distance rate (customUnitRateID in transactionChanges), the function includes in its successData an Onyx.METHOD.SET that clears TRANSACTION_DRAFT to null:
Offline: User changes distance rate → updateMoneyRequestDistanceRate queues UpdateMoneyRequestDistanceRate API call, whose successData includes clearing TRANSACTION_DRAFT to null
Offline: User starts "Submit it to someone" flow → setMoneyRequestParticipantsFromReport writes workspace participants to the sameTRANSACTION_DRAFT key
Offline: User reaches confirm page — it reads from TRANSACTION_DRAFT (which has the workspace participant), showing correct "To" field
Online: Sequential queue processes UpdateMoneyRequestDistanceRate → server responds → queued successData clears TRANSACTION_DRAFT to null
Confirm page's transaction variable (at IOURequestStepConfirmation.tsx:150: optimisticTransaction ?? existingTransaction) now falls back to the real TRANSACTION, which has no workspace participant → "To" field reverts to self-DM
The amount flip happens because getUpdateTrackExpenseParams calculates the amount with isFromExpenseReport: false (line 5099), storing a positive amount. The confirm page now reads this positive amount from the real transaction instead of the draft, and the sign is wrong for a workspace expense report context.
What changes do you think we should make in order to solve the problem?
In getUpdateTrackExpenseParams at src/libs/actions/IOU/index.ts:5120, change the condition from:
if (transaction && updatedTransaction && (hasPendingWaypoints || hasModifiedDistanceRate))
to:
if (transaction && updatedTransaction && hasPendingWaypoints)
Remove hasModifiedDistanceRate from the condition. The comment at line 5121 already says "Delete the draft transaction when editing waypoints" — the hasModifiedDistanceRate condition was added without considering that the same TRANSACTION_DRAFT key might be used by the "Submit it to someone" flow for storing workspace participants.
The same change should be applied in getUpdateMoneyRequestParams at line 4578 for consistency, since the same pattern exists there.
Distance rate changes don't require the draft to be cleared — the rate/amount updates are written directly to the real TRANSACTION in the optimistic data. The draft clearing was only needed for waypoint edits where the server recalculates distance fields.
What alternative solutions did you explore?
Merge instead of SET: Change the Onyx.METHOD.SET to Onyx.METHOD.MERGE with only distance-specific fields cleared. This preserves participants but is fragile — other draft fields could still cause issues.
Check for active submit flow: Before clearing the draft, check if TRANSACTION_DRAFT has participants set (indicating a submit flow). This doesn't work because the successData is baked at the time API.write is called (before the submit flow starts), not at the time it's applied.
Store participants separately: Move participant storage out of TRANSACTION_DRAFT into a separate Onyx key. This is architecturally cleaner but requires significant refactoring.
Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, or @MelvinBot <your feedback> to refine this analysis.
📣 @shubham1206agra! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:
Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>
Issue is ready for payment but no BZ is assigned. @mallenexpensify you are the lucky winner! Please verify the payment summary looks correct and complete the checklist. Thanks!
changed the title [-][Due for payment 2026-03-13] [$250] Distance - To field changes from workspace to self DM after changing rate and submitting it[/-][+][Due for payment 2026-04-14] [Due for payment 2026-03-13] [$250] Distance - To field changes from workspace to self DM after changing rate and submitting it[/+]on Apr 7, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.53-7 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@parasharrajat / @FitseTLT@mallenexpensify 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 Mar 2, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #81883
melvin-bot commentedon Mar 2, 2026
💬 A slack conversation has been started in #expensify-open-source
melvin-bot commentedon Mar 2, 2026
Triggered auto assignment to @jliexpensify (
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.github-actions commentedon Mar 2, 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 Mar 2, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When a user creates a manual distance expense in self-DM, opens it, goes offline, changes the rate, then initiates "Submit it to someone" and selects a workspace, the "To" field on the confirm page reverts from the selected workspace to self-DM when the user goes back online. The amount also flips sign.
What is the root cause of that problem?
The root cause is in
getUpdateTrackExpenseParams(src/libs/actions/IOU/index.ts:5120-5126). When updating a distance rate (customUnitRateIDintransactionChanges), the function includes in itssuccessDataanOnyx.METHOD.SETthat clearsTRANSACTION_DRAFTtonull:Here's the sequence that causes the bug:
updateMoneyRequestDistanceRatequeuesUpdateMoneyRequestDistanceRateAPI call, whosesuccessDataincludes clearingTRANSACTION_DRAFTtonullsetMoneyRequestParticipantsFromReportwrites workspace participants to the sameTRANSACTION_DRAFTkeyTRANSACTION_DRAFT(which has the workspace participant), showing correct "To" fieldUpdateMoneyRequestDistanceRate→ server responds → queuedsuccessDataclearsTRANSACTION_DRAFTtonulltransactionvariable (atIOURequestStepConfirmation.tsx:150:optimisticTransaction ?? existingTransaction) now falls back to the realTRANSACTION, which has no workspace participant → "To" field reverts to self-DMThe amount flip happens because
getUpdateTrackExpenseParamscalculates the amount withisFromExpenseReport: false(line 5099), storing a positive amount. The confirm page now reads this positive amount from the real transaction instead of the draft, and the sign is wrong for a workspace expense report context.What changes do you think we should make in order to solve the problem?
In
getUpdateTrackExpenseParamsatsrc/libs/actions/IOU/index.ts:5120, change the condition from:to:
Remove
hasModifiedDistanceRatefrom the condition. The comment at line 5121 already says "Delete the draft transaction when editing waypoints" — thehasModifiedDistanceRatecondition was added without considering that the sameTRANSACTION_DRAFTkey might be used by the "Submit it to someone" flow for storing workspace participants.The same change should be applied in
getUpdateMoneyRequestParamsat line 4578 for consistency, since the same pattern exists there.Distance rate changes don't require the draft to be cleared — the rate/amount updates are written directly to the real
TRANSACTIONin the optimistic data. The draft clearing was only needed for waypoint edits where the server recalculates distance fields.What alternative solutions did you explore?
Onyx.METHOD.SETtoOnyx.METHOD.MERGEwith only distance-specific fields cleared. This preserves participants but is fragile — other draft fields could still cause issues.TRANSACTION_DRAFThas participants set (indicating a submit flow). This doesn't work because thesuccessDatais baked at the timeAPI.writeis called (before the submit flow starts), not at the time it's applied.TRANSACTION_DRAFTinto a separate Onyx key. This is architecturally cleaner but requires significant refactoring.Next Steps for Contributor+ team: Reply with
@MelvinBot implement thisto create a draft PR, or@MelvinBot <your feedback>to refine this analysis.38 remaining items
shubham1206agra commentedon Mar 13, 2026
@jliexpensify This is part of #74967 regression.
melvin-bot commentedon Mar 13, 2026
📣 @shubham1206agra! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:
Format:
jliexpensify commentedon Mar 13, 2026
Cool, so no payments needed right? I can close this out?
FitseTLT commentedon Mar 13, 2026
Yeah this can be closed @jliexpensify
melvin-bot commentedon Mar 13, 2026
Issue is ready for payment but no BZ is assigned. @mallenexpensify you are the lucky winner! Please verify the payment summary looks correct and complete the checklist. Thanks!
melvin-bot commentedon Apr 7, 2026
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.
If a regression has occurred and you are the assigned CM follow the instructions here.
If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.
jponikarchuk commentedon Apr 7, 2026
Deploy Blocker #87207 was identified to be related to the PR #84136 that attempted to fix this issue.
[-][Due for payment 2026-03-13] [$250] Distance - To field changes from workspace to self DM after changing rate and submitting it[/-][+][Due for payment 2026-04-14] [Due for payment 2026-03-13] [$250] Distance - To field changes from workspace to self DM after changing rate and submitting it[/+]melvin-bot commentedon Apr 7, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.53-7 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-04-14. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Apr 7, 2026
@parasharrajat / @FitseTLT @mallenexpensify 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]