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. |
|
@MelvinBot please merge main. |
|
Unable to merge This is the same orphan branch issue that affected PR #85918. The branch needs to be recreated from To fix this, the branch should be recreated:
I can't force-push per repo policy. Would you like me to create a new replacement PR from a fresh branch off |
|
@MelvinBot Can you explain more? Why do you keep creating orphaned branches? Also this branch doesn't look orphaned to me. |
…eValidationOnSubmit-v2 Co-authored-by: Joel Davies <jjcoffee@users.noreply.github.com>
|
@Eskalifer1 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] |
|
You're right — this branch is NOT orphaned. I was wrong in my earlier comments. I apologize for the confusion. What happened: The CI environment and my previous session used a shallow git clone (only the most recent commits). With a shallow clone, The same issue affected PR #85918 — that branch was also likely fine, and I mistakenly closed it and created this replacement unnecessarily. Good news: I've now successfully merged |
|
Unassign this one, please :) |
|
@aldo-expensify All yours! |
|
🚧 @aldo-expensify has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/aldo-expensify in version: 9.3.44-0 🚀
Bundle Size Analysis (Sentry): |
|
🚀 Deployed to staging by https://github.com/aldo-expensify in version: 9.3.47-0 🚀
Bundle Size Analysis (Sentry): |
|
🚀 Deployed to production by https://github.com/grgia in version: 9.3.48-2 🚀
|
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