Fix distance rate auto-selection when submitting from Self DM to workspace#85942
Fix distance rate auto-selection when submitting from Self DM to workspace#85942
Conversation
Add a targeted guard to distinguish between the Self DM submission flow
(FAKE_P2P_ID) and the upgrade/new-rate-creation flow ('-1') so that
the rate validation error is correctly shown when submitting from Self DM.
Co-authored-by: Joel Davies <jjcoffee@users.noreply.github.com>
|
This PR replaces #85918 which had an orphan branch that couldn't be merged with Please mark this as "Ready for review" when ready (tag me with |
|
The failing check is unrelated to this PR. Failing check: Error: Analysis: This is a CI build infrastructure issue where Evidence: The error occurs at |
|
@MelvinBot make this ready for review |
|
This PR has been marked as ready for review! 🚀 |
|
@hungvu193 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppandroid-app-regression-2026-03-20_12.41.12.mp4Android: mWeb Chromeandroid-chrome-regression-2026-03-20_12.47.58.mp4iOS: HybridAppios-app-regression-2026-03-20_12.24.48.mp4iOS: mWeb Safariios-safari-regression-2026-03-20_12.25.44.mp4MacOS: Chrome / Safaridesktop-chrome-regression-2026-03-20_11.29.36.mp4 |
|
@hungvu193 Ignore the ping - this is a regression fix. |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@MelvinBot please unassign me |
|
I'm not able to remove reviewer assignments. The PR assignee ( |
|
The failing checks ( Evidence:
These are pre-existing CI infrastructure failures, not caused by the code change in this PR. |
Explanation of Change
PR #84850 removed the
isMovingTransactionFromTrackExpenseguard from the auto-rate-updateuseEffectinMoneyRequestConfirmationList.tsxto fix issue #82629 (new custom rates not being selected after upgrade flow). However, removing the guard entirely also affected the standard Self DM submission flow, causing it to auto-select the workspace's distance rate instead of showing the "Rate not valid for this workspace" error.This PR adds a targeted guard that distinguishes between the two flows based on the sentinel value of
customUnitRateID:FAKE_P2P_ID(submit-from-Self-DM flow): The guard blocks the auto-rate-update effect, allowing the rate validation effect to correctly show the "Rate not valid" error.'-1'(upgrade/new-rate-creation flow): The guard does NOT block, preserving the fix from PR Fix distance rate not selected after creating new rate from self DM #84850 for issue [Due for payment 2026-03-30] [$250] Distance - New rate is not selected after entering new rate when submitting distance from self DM #82629.Fixed Issues
$ #85879
PROPOSAL: #85879 (comment)
Tests
Offline tests
N/A - This change only affects the rate selection logic on the confirmation page, which requires online access to fetch policy rates.
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari