Fix: distance Rate list empty after self-DM → workspace when submissions off - #98592
Fix: distance Rate list empty after self-DM → workspace when submissions off#98592MelvinBot wants to merge 2 commits into
Conversation
…ipant Co-authored-by: Eugene Voloshchak <eVoloshchak@users.noreply.github.com>
|
I created this PR from an upstream branch since I don't have push access to your fork. To take ownership of this branch and be able to push updates, run: Then you can close this PR and open a new one from your fork. |
Co-authored-by: Eugene Voloshchak <eVoloshchak@users.noreply.github.com>
|
Fixed the failing Oxfmt check. The The other two failing checks are non-blocking and not related to the code:
|
|
No failing checks right now. The Oxfmt failure was already fixed in If any check fails once this run settles, re-tag me and I'll dig in. |
|
No code fix needed — the earlier Oxfmt failure is resolved and now passing. The only two remaining failing checks are non-blocking and not tied to the code:
All other checks are passing or currently re-running. |
|
|
|
The Oxfmt check I fixed earlier now passes. The remaining failing checks are all unrelated to this PR (which only touches
Evidence
|
|
The two remaining failing checks are not related to this PR — no fix to push.
The other two red checks ( A re-run should clear both |
Explanation of Change
When a workspace has submissions (delayed submission) disabled, the new manual-expense flow seeds a Track distance expense onto the self-DM, whose report carries the placeholder
_FAKE_policy. Selecting a workspace chat via the in-place "To" picker updates the transaction participants, but the confirmation route still points at the self-DM.The confirmation page already works around this (#96576) by resolving the policy from the selected participant (
selectedWorkspacePolicyID), which is why the Rate menu item there shows the correct rate. The Rate page never got that workaround — it passed the self-DM'sreport?.policyID(_FAKE_/undefined) straight intousePolicyForTransaction, sogetMileageRates()ran against an undefined policy and the rate list rendered empty.This change makes
IOURequestStepDistanceRateresolve its policy from the selected workspace participant (mirroringselectedWorkspacePolicyIDon the confirmation page), falling back to the routereport?.policyIDwhen there's no participant policy — so the workspace's distance rates load. The fallback keeps every other flow (editing, split, P2P) unchanged.🤖 Melvin automated checks
Ran locally on the changed file: ESLint (
lint-changed),typecheck-tsgo,react-compiler-compliance-check, and the distance-rate unit suites (DistanceRateTest,useDistanceRateOriginalPolicyTest,DistanceRequestUtilsTest) — all passed.Live web verification of the repro flow could not be completed: the test session's page rendered blank (an environment issue unrelated to this change — the same environment issue noted during the original investigation). The human co-author should complete the manual
Tests/QAsteps below.Fixed Issues
$ #98323
PROPOSAL: #98323 (comment)
Tests
Offline tests
Same as tests.
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, 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.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