Repository navigation
Display correct unit for commuter exclusions - #94457
Conversation
|
@sobitneupane 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] |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
Assigning @fedirjh as part of this project |
| const isSameDistance = existingMethod === CONST.POLICY.COMMUTER_EXCLUSION_METHOD.FIXED_DISTANCE && existingCommuterExclusions?.fixedDistance === numeric; | ||
| const isSameUnit = existingCommuterExclusions?.fixedDistanceUnit === workspaceUnit; | ||
| if (isSameDistance && isSameUnit) { |
There was a problem hiding this comment.
@Gonals I think this will not fix the bug: Unit is Km but exclude commuter mention Mi
The problem is within this line which uses policy.commuterExclusions.fixedDistanceUnit not the defaultUnit
It seems we need to update SetPolicyDistanceRatesUnit command on the backend side to update the commuter rate unit saved on the policy object, which is not the case right now.
There was a problem hiding this comment.
Hmmm. I was thinking we could leave it with the unit it was setup. That's why we save the unit. Even if the default unit has changed, we can still calculate the exclusion with the saved unit later
There was a problem hiding this comment.
I see, that makes sense. I would expect it to change automatically. We can definitely leave it as it is for the time being.
Reviewer Checklist
Screenshots/VideosiOS: mWeb SafariCleanShot.2026-06-24.at.16.22.26.mp4MacOS: Chrome / SafariCleanShot.2026-06-24.at.16.16.22.mp4 |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 Beamanator 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! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/Beamanator in version: 9.4.19-1 🚀
Bundle Size Analysis (Sentry): |
|
🤖 No help site changes required. This PR is a bug fix for the commuter exclusions feature on workspace Distance rates ( Because this restores the intended behavior rather than changing or adding any user-facing functionality — and the commuter exclusions feature is not currently documented under What I checked
|
|
🚀 Deployed to production by https://github.com/blimpich in version: 9.4.19-5 🚀
|
Explanation of Change
Fixed Issues
$ #94267
PROPOSAL:
Tests
Offline tests
None
QA Steps
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)Avatar, 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