fix: added distance param in transaction, when submitting track expense to workspace#76423
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.
|
7d3e14f to
0a0143d
Compare
|
@DylanDylann 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] |
|
@Burhan-Rashid Coujld you merge latest main? |
done @DylanDylann |
|
@Burhan-Rashid Could you please test this PR again on a new account? I still get the error Screen.Recording.2025-12-03.at.16.58.15.mov |
Let me check again. @DylanDylann |
Are you able to reproduce it everytime? @DylanDylann |
joekaufmanexpensify
left a comment
There was a problem hiding this comment.
Fix makes sense 👍
|
@DylanDylann I tried multiple times today as well but was not able to reproduce it. |
|
@Burhan-Rashid Please merge the latest main and try again with a new account. I can reproduce it consistently. Screen.Recording.2025-12-08.at.15.50.47.mov |
|
You also can try on mobile device |
The issue is currently caused due to changes in this PR https://github.com/Expensify/App/pull/75542/files#diff-e0bbc1d7016fc365a636f5e1d9928913f99dc8a5e532727c6ebb9c2bbd1181bbR1400-R1403 App/src/libs/TransactionUtils/index.ts Lines 1397 to 1402 in 5efe152 Which causes the hasRoute to return false for track distance requests created in selfDM, which makes both amount and distance field to show incorrect data on UI and also while creating the track distance request, it sends the merchant field as pending which is causing the issue currently. After reverting the these changes locally, the issue is still difficult to reproduce on web. I am still debugging the mobile device. Is there a way to check the network requests of IOS simulator currently @DylanDylann track.distance.issue.mp4 |
@Burhan-Rashid Thanks for your investigation. Do you have any suggestion to fix this? |
Yes, @DylanDylann we can fix that by adding the name: CONST.CUSTOM_UNITS.NAME_DISTANCE property inside the comment.customUnit here for draft transactions: Lines 1106 to 1113 in fb3822e if (!isFromGlobalCreate) {
const isPolicyExpenseChat = isPolicyExpenseChatReportUtil(report) || isPolicyExpenseChatReportUtil(parentReport);
const customUnitRateID = DistanceRequestUtils.getCustomUnitRateID({reportID, isPolicyExpenseChat, policy, lastSelectedDistanceRates});
comment.customUnit = {customUnitRateID, name: CONST.CUSTOM_UNITS.NAME_DISTANCE};
} else if (hasOnlyPersonalPolicies(allPolicies)) {
comment.customUnit = {customUnitRateID: CONST.CUSTOM_UNITS.FAKE_P2P_ID, name: CONST.CUSTOM_UNITS.NAME_DISTANCE};
} |
|
@Burhan-Rashid This fix works on all platform, right? |
I still need to test the IOS simulator. I will update you after i properly investigate the Original issue. @DylanDylann |
|
The issue was still happening for some specific distance values( very large values e.g 1.80435000100005). App/src/pages/iou/request/step/IOURequestStepDistanceManual.tsx Lines 164 to 165 in 0278b2c Now it is working perfectly fine. |
|
There is some failing test on latest main not related to our changes. I will merge the latest main, once the test gets fixed by someone. |
|
@Burhan-Rashid Could you merge the new main? |
done @DylanDylann |
|
@Burhan-Rashid The change is working fine. Thanks for the quick fix |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2025-12-11.at.16.27.48.movAndroid: mWeb ChromeScreen.Recording.2025-12-10.at.18.34.44.moviOS: HybridAppScreen.Recording.2025-12-11.at.16.28.56.moviOS: mWeb SafariScreen.Recording.2025-12-10.at.18.31.46.movMacOS: Chrome / SafariScreen.Recording.2025-12-10.at.18.29.19.mov |
|
✋ 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.2.78-0 🚀
|
|
🚀 Deployed to production by https://github.com/AndrewGable in version: 9.2.78-8 🚀
|
Explanation of Change
Fixed Issues
$#74641
PROPOSAL:#74641 (comment)
Tests
Prerequisites:
• Self-DM chat available
• Workspace available
Steps:
Offline tests
Same as tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
Same as tests
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
android.native.mp4
Android: mWeb Chrome
android.web.mp4
iOS: Native
ios.native.mp4
iOS: mWeb Safari
ios.web.mp4
MacOS: Chrome / Safari
macos.Web.mp4