-
Notifications
You must be signed in to change notification settings - Fork 3.6k
fix: Incorrect currency displayed when creating Distance expense in selfDM #81930
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nkdengineer Could you check this one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine for product
|
@nkdengineer Can you merge main? Thanks |
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