[CP Stg] Fix tax amount manual adjustment#73391
Conversation
| routeError, | ||
| isDelegateAccessRestricted, | ||
| showDelegateNoAccessModal, | ||
| setDidConfirmSplit, |
There was a problem hiding this comment.
I mentioned this in the PR description, but I had to add this to make React Compiler happy
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2025-10-24.at.13.45.26.movAndroid: mWeb ChromeScreen.Recording.2025-10-24.at.13.52.51.moviOS: HybridAppiOS: mWeb SafariScreen.Recording.2025-10-24.at.13.51.15.movMacOS: Chrome / Safarioutput.mp4MacOS: DesktopScreen.Recording.2025-10-24.at.13.42.09.mov |
|
@roryabraham @lakchote Do we need the C+ for this one? I asked because I see that @lakchote has already approved this PR |
yes please continue your review @truph01 |
Any ETA for the review @truph01? It's the last blocker to fix before we can proceed with the deploy (after testing it on staging too). If you're not sure you can finish it in the next hour, please let me know and I'll proceed with the merge. |
|
@lakchote I am on it and can finish the review in the next hour |
|
@roryabraham The tax amount is always 0 when tracking distance, could you help check it: output.mp4 |
|
@truph01 is it working on main for you? |
Yes, I did it 4. Go to workspace settings -> distance rates -> settings -> enable tax tracking
In staging, it doesn't work as well output.mp4I checked the logic and saw that, the App/src/libs/DistanceRequestUtils.ts Line 338 in bd83ec9 in my policy is undefined. |
|
@roryabraham Yes, if I try to set the taxClaimablePercentage, now the tax is shown in the confirmation page as expected. |
|
This seems like a problem specific to the policy you're testing then. |
|
@truph01 it's been more than an hour now, when do you expect to finish the review please? 🙏 |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / SafariMacOS: Desktop |
@lakchote I'm currently blocked on recording video on the iOS platform; everything else looks good across other platforms. |
It's fine as there shouldn't be any edge case related to iOS given the code changes, I'll proceed with the merge |
[CP Stg] Fix tax amount manual adjustment (cherry picked from commit 0f48666) (cherry-picked to staging by lakchote)
|
@roryabraham Could you add this note to the test steps:
|
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Cherry-picked to staging by https://github.com/lakchote in version: 9.2.37-8 🚀
|
|
CP is passed for Web, mWeb and Native apps. Still pending validation for Desktop 1761295878331.2025-10-24_11_48_26.mp41761295857135.2025-10-24_11_47_10.mp41761295843856.2025-10-24_11_38_16.mp41761295823266.2025-10-24_11_37_36.mp4 |
|
🚀 Deployed to production by https://github.com/blimpich in version: 9.2.37-8 🚀
|
|
🚀 Cherry-picked to staging by https://github.com/lakchote in version: 9.2.38-0 🚀
|
|
🚀 Deployed to production by https://github.com/puneetlath in version: 9.2.38-5 🚀
|

Explanation of Change
I fixed this bug by following the guidelines from https://react.dev/learn/you-might-not-need-an-effect. We don't need to (and shouldn't) use effects to compute values that are derived from state and props. Instead, we can compute them in render.
useEffectis appropriate to sync React with an external system: in this case, Onyx. So we do keep the effect to save the tax amount to the draft transaction in Onyx.It's not necessary to memoize these calculations, because React Compiler is doing it for us. Initially my changes broke the React Compiler for this file (for reasons I don't fully understand), but adding a missing dependency on an effect fixed it.
Fixed Issues
$ #73309
Tests
Prerequisites
Create a workspace
Enable tax and distance rates
Set up two tax rates:
Go to workspace settings -> distance rates -> settings -> enable tax tracking
Go to workspace settings -> distance rates -> choose a distance rate -> add a tax rate
Test changing tax rate manually
Test changing tax amount manually
Test changing waypoints
Test changing currency
Offline tests
None.
QA Steps
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: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
web.mov
MacOS: Desktop