fix: no RBR when deleting distance rates#57767
fix: no RBR when deleting distance rates#57767aldo-expensify merged 4 commits intoExpensify:mainfrom
Conversation
|
@paultsimura 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] |
| const transactions = Object.values(allTransactions ?? {}).filter((transaction) => transaction?.comment?.customUnit?.customUnitID === customUnit.customUnitID); | ||
| const optimisticTransactionsViolations: OnyxUpdate[] = []; |
There was a problem hiding this comment.
We should check that these transaction actually belong to reports that are associated to the policy with policyID
There was a problem hiding this comment.
We probably should check for the report state/status too. I don't think we want to add violations we can't resolve to reports have already been payed for example.
There was a problem hiding this comment.
We should check that these transaction actually belong to reports that are associated to the policy with
policyID
We filter transactions using customUnit.customUnitID so it will filter out other policy transactions as well.
We probably should check for the report state/status too. I don't think we want to add violations we can't resolve to reports have already been payed for example.
Violation also appear on paid expense
There was a problem hiding this comment.
We should check that these transaction actually belong to reports that are associated to the policy with policyID
We filter transactions using customUnit.customUnitID so it will filter out other policy transactions as well.
customUnitID are not necessarily unique across workspaces, but I see now that we generate them randomly with a shape like 52F16411C502C so it is VERY unlikely to have collisions. Considering that, I think we can ignore checking the policyID.
We probably should check for the report state/status too. I don't think we want to add violations we can't resolve to reports have already been payed for example.
Violation also appear on paid expense
Ahh nice, I didn't know :)
I can confirm: we add a violation, but do not show the RBR in LHN for paid requests:
Thanks for confirming @paultsimura !
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb Chromechrome.webmiOS: NativeSimulator.Screen.Recording.-.iPhone.15.Pro.-.2025-03-05.at.16.50.35.mp4iOS: mWeb SafariSimulator.Screen.Recording.-.iPhone.15.Pro.-.2025-03-05.at.16.34.41.mp4MacOS: Chrome / SafariScreen.Recording.2025-03-05.at.16.09.39.movMacOS: DesktopScreen.Recording.2025-03-05.at.16.18.47.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.1.10-0 🚀
|
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.1.10-6 🚀
|
| }, | ||
| ]; | ||
|
|
||
| const transactions = Object.values(allTransactions ?? {}).filter((transaction) => transaction?.comment?.customUnit?.customUnitID === customUnit.customUnitID); |
There was a problem hiding this comment.
This line logic is setting violations for all transactions with the specific customUnitID instead of checking for the customUnitRateID which led to this issue:
which we fixed by filtering for transactions with customUnitRateID as the deleted one.


Explanation of Change
Fixed Issues
$ #57579
PROPOSAL: #57579 (comment)
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))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.2025-03-04.at.22.49.56.mov
Android: mWeb Chrome
Screen.Recording.2025-03-04.at.22.47.45.mov
iOS: Native
Screen.Recording.2025-03-04.at.22.45.57.mov
iOS: mWeb Safari
Screen.Recording.2025-03-04.at.22.43.55.mov
MacOS: Chrome / Safari
Screen.Recording.2025-03-04.at.22.41.34.mov
MacOS: Desktop
Screen.Recording.2025-03-04.at.22.39.38.mov