Repository navigation
Description
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 9.3.74-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from BrowserStack: https://test-management.browserstack.com/projects/2219752/test-runs/TR-28774/folder/18717689/49855697/1413061698
Email or phone of affected tester (no customers): applausetester+ck513261@applause.expensifail.com
Issue reported by: Applause Internal Team
Bug source: Regression TC Execution
Device used: Windows 11/Chrome, Pixel 8a/Android 16
App Component: Money Requests
Action Performed:
Precondition:
- Use Expensifail account (or gmail account)
- The user does not have workspace
- User have Self-DM
Steps:
- Launch Hybrid app or navigate to staging.new.expensify.com
- Login with new account
- Click the + global create button, select "Track Distance", and go to the "Manual" tab
- Enter a valid distance and click "Next"
- Select the user’s email address(Personal) as the recipient
- Click the "Rate" option row and click "Upgrade" (A workspace will be created for the user at this stage)
- Set a custom distance rate and click "Save"
- Observe the To field do not update to new WS name. Instead, still Self DM displayed
Expected Result:
After saving custom distance rate, user get redirected to the "Confirm details" page and the recipient field should get updated to the new workspace name
Actual Result:
Recipient field do not get updated to the new workspace name after upgrading & saving custom distance rate. To field still display the Self DM, user has to select the created WS tapping To field for the manual distance expense to get create in new WS
Workaround:
Unknown
Platforms:
- Android: App
- Android: mWeb Chrome
- iOS: App
- iOS: mWeb Safari
- iOS: mWeb Chrome
- Windows: Chrome
- MacOS: Chrome / Safari
Screenshots/Videos
Video.mp4
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~022054880018343470361
- Upwork Job ID: 2054880018343470361
- Last Price Increase: 2026-05-21
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
melvin-bot commentedon May 14, 2026
Triggered auto assignment to @yuwenmemon (
DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.github-actions commentedon May 14, 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:
melvin-bot commentedon May 14, 2026
💬 A slack conversation has been started in #expensify-open-source
melvin-bot commentedon May 14, 2026
Current assignee @yuwenmemon is eligible for the Engineering assigner, not assigning anyone new.
MelvinBot commentedon May 14, 2026
Proposal
What is the root cause of that problem?
When a user clicks "Rate" → "Upgrade" during the Track Distance flow, a new workspace is created but the transaction's participants are never updated to reflect it. The "To" field stays on Self-DM.
In
IOURequestStepUpgrade.tsx, theafterUpgradeAcknowledgedcallback has two guards that skip participant updates for track expenses:setMoneyRequestParticipantsis gated behindshouldSubmitExpense, which isfalsefor track expenses (set as!isTrackExpenseinRateField.tsx:85).setTransactionReportis gated behind!isTrack, so the transaction's reportID also remains the self-DM.Neither
CreateDistanceRatePage(only updates the rate) nor theIOURequestStepConfirmationuseEffect (short-circuits when participants already exist) compensates for the missing update.What changes do you think we should make in order to solve the problem?
In
IOURequestStepUpgrade.tsx, within theDISTANCE_RATEScase ofafterUpgradeAcknowledged, callsetMoneyRequestParticipantsfor track expenses too (when it's a distance rate upgrade). The transaction participants should be updated to reference the new workspace's policy expense chat, similar to how it's done whenshouldSubmitExpenseis true. Specifically, theif (shouldSubmitExpense)guard at line 160 should also allow the distance-rate-upgrade + track-expense case through, so the participant is set to the newly created workspace.What alternative solutions did you explore? (Optional)
An alternative would be to update participants in
CreateDistanceRatePageafter saving the rate, or to modify theIOURequestStepConfirmationuseEffect to detect the post-upgrade state and re-set participants. However, updating participants at the point of upgrade inIOURequestStepUpgrade.tsxis the most direct fix since that's where the workspace is created and where the non-track path already handles this correctly.Next Steps for Contributor+ team: Reply with
@MelvinBot implement thisto create a draft PR,@MelvinBot <your feedback>to refine this analysis, or explain why you are rejecting Melvin's proposal.20 remaining items
abbasifaizan70 commentedon May 14, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When a user without a workspace creates a manual distance expense in Self-DM, then upgrades via the "Rate" option to use custom distance rates, the recipient ("To") field does not update to show the new workspace name. The field incorrectly remains as Self-DM, requiring the user to manually tap the "To" field and select the newly created workspace.
What is the root cause of that problem?
The issue is in
IOURequestStepUpgrade.tsxin theafterUpgradeAcknowledgedfunction.1. Participants are not updated for track expenses
App/src/pages/iou/request/step/IOURequestStepUpgrade.tsx
Lines 160 to 171 in da0f92e
The problem is that
shouldSubmitExpenseisfalsefor track expenses. This is set inRateField.tsx:App/src/components/MoneyRequestConfirmationList/sections/RateField.tsx
Line 85 in da0f92e
So for track expenses,
setMoneyRequestParticipantsis never called, and the participants remain pointing to Self-DM.2. Transaction report is not updated for track expenses
App/src/pages/iou/request/step/IOURequestStepUpgrade.tsx
Lines 185 to 193 in da0f92e
The comment says "For track expense, we want to create the expense inside self dm" - but this logic doesn't account for the upgrade flow where the user is explicitly creating a workspace to use custom distance rates. When upgrading, the expense should be moved to the new workspace.
What changes do you think we should make in order to solve the problem?
For distance rate upgrades, we should update the participants and transaction report to use the new workspace, regardless of whether it's a track expense. When a user upgrades to use custom distance rates, they're explicitly choosing to use workspace features.
Fix in
src/pages/iou/request/step/IOURequestStepUpgrade.tsx:Change 1: Update the condition to also include distance rate upgrades
App/src/pages/iou/request/step/IOURequestStepUpgrade.tsx
Line 159 in da0f92e
Change 2: Update the DISTANCE_RATES case to always use expenseReportID
App/src/pages/iou/request/step/IOURequestStepUpgrade.tsx
Lines 172 to 194 in da0f92e
case CONST.UPGRADE_PATHS.DISTANCE_RATES: { if (!policyID || !reportID) { Navigation.goBack(); return; } - // In case we get here from /:action/track/... route we need to navigate to - // /:action/submit/... when shouldSubmitExpense === true as transaction is not selfDM anymore - const backToRoute = shouldSubmitExpense ? ROUTES.MONEY_REQUEST_STEP_CONFIRMATION.getRoute(action, CONST.IOU.TYPE.SUBMIT, transactionID, reportID) : undefined; + // Navigate to submit confirmation route since the expense is now in the workspace + const backToRoute = ROUTES.MONEY_REQUEST_STEP_CONFIRMATION.getRoute(action, CONST.IOU.TYPE.SUBMIT, transactionID, expenseReportID); Navigation.goBack(backToRoute, {compareParams: false}); - // For track expense, we want to create the expense inside self dm (which is not expenseReportID). - if (!isTrack) { - setTransactionReport(transactionID, {reportID: expenseReportID}, true); - // Let the confirmation step decide the distance rate because policy data is not fully available at this step - setCustomUnitRateID(transactionID, '-1', undefined, undefined); - Navigation.setParams({reportID: expenseReportID}); - } + // Update transaction to use the new workspace expense report for all distance rate upgrades + setTransactionReport(transactionID, {reportID: expenseReportID}, true); + // Let the confirmation step decide the distance rate because policy data is not fully available at this step + setCustomUnitRateID(transactionID, '-1', undefined, undefined); + Navigation.setParams({reportID: expenseReportID}); - navigateWithMicrotask(ROUTES.WORKSPACE_CREATE_DISTANCE_RATE_UPGRADE.getRoute(policyID, transactionID, isTrack ? reportID : expenseReportID, iouType, action)); + navigateWithMicrotask(ROUTES.WORKSPACE_CREATE_DISTANCE_RATE_UPGRADE.getRoute(policyID, transactionID, expenseReportID, iouType, action)); break; }github-actions commentedon May 14, 2026
emkhalid commentedon May 16, 2026
Proposal
What is the root cause of that problem?
In
src/pages/iou/request/step/IOURequestStepUpgrade.tsx,afterUpgradeAcknowledged()updates the transaction participant to the new workspace only whenshouldSubmitExpenseis true.App/src/pages/iou/request/step/IOURequestStepUpgrade.tsx
Lines 160 to 170 in 809efef
For the reported flow, the Rate row opens the distance-rate upgrade with
shouldSubmitExpense: !isTrackExpense.App/src/components/MoneyRequestConfirmationList/sections/RateField.tsx
Lines 76 to 86 in 809efef
Because this is a track expense,
shouldSubmitExpenseis false. So the draft transaction keeps its existing Self-DM participant.The same upgrade callback also skips moving the transaction report for track expenses.
App/src/pages/iou/request/step/IOURequestStepUpgrade.tsx
Lines 180 to 194 in 809efef
That leaves the draft transaction attached to the Self-DM even though the user just created a workspace for the custom distance rate. After the user saves the custom distance rate, the confirmation page renders the
Tofield from the staletransaction.participantsvalue, so it still shows the Self-DM instead of the new workspace.What changes do you think we should make in order to solve the problem?
Update
IOURequestStepUpgrade.tsxso distance-rate upgrades move track expenses to the newly created workspace in the same place where the workspace is created.Original participant update code:
App/src/pages/iou/request/step/IOURequestStepUpgrade.tsx
Lines 160 to 170 in 809efef
Original distance-rate upgrade code:
App/src/pages/iou/request/step/IOURequestStepUpgrade.tsx
Lines 180 to 194 in 809efef
This keeps normal track distance behavior unchanged. It only changes the distance-rate upgrade path, where the user explicitly creates a workspace to use a workspace distance rate.
The draft transaction, confirmation route, and distance-rate creation route now all use the new workspace expense chat and
submitIOU type. That prevents the confirmation page from reading stale Self-DM participants after the rate is saved.What alternative solutions did you explore? (Optional)
One alternative is to update only
setMoneyRequestParticipants()for track distance upgrades. I rejected that because it fixes the visibleTofield but leavestransaction.reportID, the routereportID, and the routeiouTypeon the old track/Self-DM flow.Another alternative is to patch
CreateDistanceRatePage.tsxafter the user saves the custom rate. That is farther downstream and would require rediscovering the workspace expense chat there. It also spreads the upgrade transition across the rate creation page, even thoughIOURequestStepUpgrade.tsxalready owns the workspace transition.github-actions commentedon May 16, 2026
melvin-bot commentedon May 19, 2026
@cristipaval, @FitseTLT Huh... This is 4 days overdue. Who can take care of this?
FitseTLT commentedon May 20, 2026
@cristipaval this is expected behavior. Distance rate upgrade flow is an exception it should create the expense in self dm. Are u specifically suggesting a behavior change?
melvin-bot commentedon May 21, 2026
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
melvin-bot commentedon May 25, 2026
@cristipaval, @FitseTLT Huh... This is 4 days overdue. Who can take care of this?
cristipaval commentedon May 26, 2026
yeah I agree this is expected 👍