Repository navigation
fix: Incorrect currency displayed when creating Distance expense in selfDM - #81930
Conversation
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
|
@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] |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 893a837987
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| const isTrackDistanceRequest = isTrackExpense && isDistanceRequest; | ||
| const {policyForMovingExpenses} = usePolicyForMovingExpenses(undefined, undefined, isTrackDistanceRequest, isMovingTransactionFromTrackExpense); |
There was a problem hiding this comment.
Limit track-distance policy bypass to self-DM requests
isTrackDistanceRequest is computed as isTrackExpense && isDistanceRequest and passed into usePolicyForMovingExpenses, so the new early return in src/hooks/usePolicyForMovingExpenses.ts now clears policy context for all track-distance creates, not just self-DM. Track is also available in own policy expense chats (src/libs/ReportUtils.ts, getMoneyRequestOptions), and in that flow confirmation still derives distance totals from policy-backed rates; with policy forced to undefined, rate lookup can fall back incorrectly and confirmation recalculates with rate ?? 0 (MoneyRequestConfirmationList.tsx), producing wrong amount/currency. This bypass should be gated to the self-DM track-distance path only.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
all track-distance creates, not just self-DM
It's not correct, isTrackExpense is only true in selfDM.
joekaufmanexpensify
left a comment
There was a problem hiding this comment.
Fine for product
|
@nkdengineer Can you merge main? Thanks |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid.movAndroid: mWeb ChromemChrome.moviOS: HybridAppios.moviOS: mWeb SafarimSafari.movMacOS: Chrome / SafariChrome.mov |
mountiny
left a comment
There was a problem hiding this comment.
@nkdengineer Please add comment explaining Why and also add unit tests that will cover all these changes in robust way
|
🚧 @mountiny 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/mountiny in version: 9.3.20-0 🚀
|
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.3.20-6 🚀
|
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.3.20-6 🚀
|
Explanation of Change
fix: Incorrect currency displayed when creating Distance expense in selfDM
Fixed Issues
$ #80806
PROPOSAL: #80806 (comment)
Tests
Offline tests
Same
QA Steps
Same as test
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand 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
Screen.Recording.2026-02-10.at.10.48.21.mov
Android: mWeb Chrome
Screen.Recording.2026-02-10.at.10.49.06.mov
iOS: Native
Screen.Recording.2026-02-10.at.10.46.54.mov
iOS: mWeb Safari
Screen.Recording.2026-02-10.at.10.47.41.mov
MacOS: Chrome / Safari
Screen.Recording.2026-02-10.at.10.45.57.mov