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
Distance - No rate error on confirm page when submitting expense with invalid rate from self DM #87207
Version Number: 9.3.53-1 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:#84136 Email or phone of affected tester (no customers):jsdjosidjiojisojio3@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:
Enable Distance rates.
Workspace has at least two distance rates.
Go to staging.new.expensify.com
Go to self DM.
Create a manual distance expense.
Go to workspace settings > Distance rates.
Delete the rate in Step 3.
Go back in self DM.
Click Submit it to someone.
Select workspace chat.
Click Rate field on confirm page.
Expected Result:
"Rate not valid for this workspace. Please select an available rate from the workspace." error will show up because the rate is deleted.
Actual Result:
"Rate not valid for this workspace. Please select an available rate from the workspace." error does not show up when the rate is deleted.
It auto selects any rate that is available.
👋 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.
Investigation Summary: Classification: Frontend bug. Causing PR: 84136 (Feat - Add distance rate to distance expenses tracked in selfDM) by FitseTLT - High confidence. Recommendation: REVERT. PR 84136 introduced a change to MoneyRequestConfirmationList.tsx that causes the app to silently auto-select a matching rate instead of showing the Rate not valid error when a previously-selected distance rate has been deleted from the workspace. Evidence: melvin-bot assigned PR 84136 as the causing PR. PR 84136 was merged 2026-04-06 and is in StagingDeployCash for version 9.3.53-1, matching the bug report. Bug is staging-only. Verification: The affected code path is in src/components/MoneyRequestConfirmationList.tsx lines 527-552, which PR 84136 directly modifies. Root cause: PR 84136 added a fallback in the useEffect that validates distance rates. When the original selected rate is deleted from the workspace, the code now checks for a matchingRate by value and unit, and if found, silently auto-selects it and clears the error instead of displaying the Rate not valid for this workspace error. Labels: Keeping DeployBlockerCash since this is a Frontend bug caused by an App PR.
PR #84136 assigns real rate IDs (from the personal policy) to distance expenses tracked in self DM. When the user later submits the expense to a workspace chat, the confirm page runs a validation useEffect (MoneyRequestConfirmationList.tsx:527-566) that checks if the transaction's rate ID exists in the workspace policy. When it doesn't find it, instead of showing the error, it:
Calls getRate() (DistanceRequestUtils.ts:430-432) which falls back to the workspace's defaultMileageRate for non-unreported expenses
Finds a workspace rate matching by value+unit (line 544)
Auto-selects that matching rate and clears the error (lines 546-547)
This means the "Rate not valid for this workspace" error is never displayed — the rate is silently swapped to a valid workspace rate.
What changes do you think we should make in order to solve the problem?
The validation useEffect at MoneyRequestConfirmationList.tsx:544-548 should not auto-select a matching rate when the original rate was explicitly deleted from the policy. When the transaction's customUnitRateID is not found in the workspace policy's rates AND we're in a "submit to workspace" flow (moving from self DM), the code should set the iou.error.invalidRate form error instead of auto-correcting.
Specifically, the matching-by-value+unit block at line 544 should be skipped (or the error should still be set) when isMovingTransactionFromTrackExpense is true and the original rate ID doesn't exist in the target workspace's rates. This ensures the user sees the validation error and must manually pick a valid rate.
What alternative solutions did you explore? (Optional)
An alternative would be to fix this in IOURequestStepParticipants.tsx:270-283 by having addParticipant validate and flag the rate when switching to a workspace participant. However, the confirm page validation is the more appropriate place since it's the last gate before submission and already has the error display infrastructure (MoneyRequestConfirmationListFooter.tsx:453).
Investigation details
Key code paths:
Rate validation useEffect: MoneyRequestConfirmationList.tsx:527-566 — checks if rate ID is in workspace policy, auto-selects matching rate by value+unit at line 544
Rate resolution fallback: DistanceRequestUtils.ts:430-432 — getRate() falls back to defaultMileageRate for non-unreported expenses
Participant rate skip: IOURequestStepParticipants.tsx:270-283 — when isMovingTransactionFromTrackExpense && isPolicyExpenseChat, rate update is skipped, keeping the personal policy rate ID
User deletes that rate from workspace Distance rates settings
User clicks "Submit it to someone" → selects workspace chat
Confirm page mounts → validation useEffect fires → rate ID not in workspace policy → getRate() falls back to defaultMileageRate → matching-by-value+unit succeeds → auto-selects workspace rate → error cleared
No error shown to user
Related issue:#73680 — similar "Rate out of policy" error not shown issue (different flow)
Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.
P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!
Activity
melvin-bot commentedon Apr 7, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #84136
melvin-bot commentedon Apr 7, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon Apr 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 Apr 7, 2026
Investigation Summary: Classification: Frontend bug. Causing PR: 84136 (Feat - Add distance rate to distance expenses tracked in selfDM) by FitseTLT - High confidence. Recommendation: REVERT. PR 84136 introduced a change to MoneyRequestConfirmationList.tsx that causes the app to silently auto-select a matching rate instead of showing the Rate not valid error when a previously-selected distance rate has been deleted from the workspace. Evidence: melvin-bot assigned PR 84136 as the causing PR. PR 84136 was merged 2026-04-06 and is in StagingDeployCash for version 9.3.53-1, matching the bug report. Bug is staging-only. Verification: The affected code path is in src/components/MoneyRequestConfirmationList.tsx lines 527-552, which PR 84136 directly modifies. Root cause: PR 84136 added a fallback in the useEffect that validates distance rates. When the original selected rate is deleted from the workspace, the code now checks for a matchingRate by value and unit, and if found, silently auto-selects it and clears the error instead of displaying the Rate not valid for this workspace error. Labels: Keeping DeployBlockerCash since this is a Frontend bug caused by an App PR.
MelvinBot commentedon Apr 7, 2026
Proposal
What is the root cause of that problem?
PR #84136 assigns real rate IDs (from the personal policy) to distance expenses tracked in self DM. When the user later submits the expense to a workspace chat, the confirm page runs a validation useEffect (
MoneyRequestConfirmationList.tsx:527-566) that checks if the transaction's rate ID exists in the workspace policy. When it doesn't find it, instead of showing the error, it:getRate()(DistanceRequestUtils.ts:430-432) which falls back to the workspace'sdefaultMileageRatefor non-unreported expensesThis means the "Rate not valid for this workspace" error is never displayed — the rate is silently swapped to a valid workspace rate.
What changes do you think we should make in order to solve the problem?
The validation useEffect at
MoneyRequestConfirmationList.tsx:544-548should not auto-select a matching rate when the original rate was explicitly deleted from the policy. When the transaction'scustomUnitRateIDis not found in the workspace policy's rates AND we're in a "submit to workspace" flow (moving from self DM), the code should set theiou.error.invalidRateform error instead of auto-correcting.Specifically, the matching-by-value+unit block at line 544 should be skipped (or the error should still be set) when
isMovingTransactionFromTrackExpenseis true and the original rate ID doesn't exist in the target workspace's rates. This ensures the user sees the validation error and must manually pick a valid rate.What alternative solutions did you explore? (Optional)
An alternative would be to fix this in
IOURequestStepParticipants.tsx:270-283by havingaddParticipantvalidate and flag the rate when switching to a workspace participant. However, the confirm page validation is the more appropriate place since it's the last gate before submission and already has the error display infrastructure (MoneyRequestConfirmationListFooter.tsx:453).Investigation details
Key code paths:
MoneyRequestConfirmationList.tsx:527-566— checks if rate ID is in workspace policy, auto-selects matching rate by value+unit at line 544DistanceRequestUtils.ts:430-432—getRate()falls back todefaultMileageRatefor non-unreported expensesIOURequestStepParticipants.tsx:270-283— whenisMovingTransactionFromTrackExpense && isPolicyExpenseChat, rate update is skipped, keeping the personal policy rate IDMoneyRequestConfirmationListFooter.tsx:453— shows brick road indicator whenformError === 'iou.error.invalidRate'Data flow:
getRate()falls back todefaultMileageRate→ matching-by-value+unit succeeds → auto-selects workspace rate → error clearedRelated issue: #73680 — similar "Rate out of policy" error not shown issue (different flow)
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.cristipaval commentedon Apr 7, 2026
Demoting this one. It's a rare use case and doesn't block the user.
melvin-bot commentedon May 1, 2026
This issue has not been updated in over 15 days. @cristipaval, @parasharrajat, @FitseTLT eroding to Monthly issue.
P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!
cristipaval commentedon May 4, 2026
the fix is in prod