perf: create report transactions and violations derived value#65247
Conversation
…sed-transactions-derived-value
…ort-transactions-derived-value
|
@eVoloshchak 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] |
|
Simplified the solution a bit comparing to the original one to avoid prop drilling and instead introduced the values in the @Pujan92 can I ask you for an additional review since you found a couple of issues in the original PR? @luacmartins could you test the flow from original PR with this branch or provide more detailed repro steps? |
luacmartins
left a comment
There was a problem hiding this comment.
@TMisiukiewicz I still see the original issue. See the video below
Steps:
- Scan a receipt
- Tap
More - Tap
Split - Split the expense
- Notice that the original transaction remains on the list
Expected behavior: only the split transactions should be on the list
Screen.Recording.2025-07-01.at.4.16.10.PM.mov
|
@luacmartins thank you! Found a root cause of the issue and fixed it - could you give it one more try please? |
|
🚀 Deployed to staging by https://github.com/roryabraham in version: 9.1.79-0 🚀
|
|
🚀 Deployed to production by https://github.com/Julesssss in version: 9.1.79-11 🚀
|
| const previousTransaction = previousTransactions?.[transactionKey]; | ||
| const previousReportID = previousTransaction?.reportID; | ||
|
|
||
| if (previousReportID && previousReportID !== reportID && reportTransactionsAndViolations[previousReportID]) { |
| return []; | ||
| } | ||
|
|
||
| function getAllNonDeletedTransactions(transactions: OnyxCollection<Transaction>, reportActions: ReportAction[]) { |
There was a problem hiding this comment.
Coming from #70185 checklist: We’ve changed the intent of this function, and we also need to handle filter out deleted reports in offline mode.
Explanation of Change
Another approach to add performance optimization by creating
reportsTransactionsAndViolationsderived value since the previous one was reverted.Fixed Issues
$ #64163
PROPOSAL:
Tests
Offline 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 stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.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
android.mov
Android: mWeb Chrome
iOS: Native
ios.mp4
iOS: mWeb Safari
ios.web.mp4
MacOS: Chrome / Safari
web.mov
MacOS: Desktop
desktop.mov