[Perf] Scope REPORT_ACTIONS subscription to per-row level in LHNOptionsList #84262
[Perf] Scope REPORT_ACTIONS subscription to per-row level in LHNOptionsList #84262waterim wants to merge 7 commits intoExpensify:mainfrom
Conversation
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@jayeshmangwani 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] |
|
@jayeshmangwani You are right! Updated the PR, removed receiptTransactions, fixed the code to reflect on that and resolved conflicts! |
|
Thanks for the changes! I’ll test the PR now. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a89b54f22b
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroi.movAndroid: mWeb Chromemweb-chrome.moviOS: HybridAppioS.moviOS: mWeb Safarimweb-safari.movMacOS: Chrome / Safariweb.mov |
…ctions-low-lvl # Conflicts: # src/components/LHNOptionsList/LHNOptionsList.tsx # src/components/LHNOptionsList/OptionRowLHNData.tsx # src/components/LHNOptionsList/types.ts
|
@codex review |
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d30ced7ae3
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
|
||
| const [reportActions] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${reportID}`); | ||
| const [parentReportActions] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${getNonEmptyStringOnyxID(fullReport?.parentReportID)}`); | ||
| const [transactionThreadReportActions] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${getNonEmptyStringOnyxID(oneTransactionThreadReport?.reportID)}`); |
There was a problem hiding this comment.
Use derived thread ID when subscribing to thread actions
Subscribe to transaction-thread actions using oneTransactionThreadReport?.reportID can miss updates whenever the child report object is not yet present in Onyx (but oneTransactionThreadReportID is already known from derived attributes, including optimistic/FAKE_REPORT_ID flows). In that case this key resolves to REPORT_ACTIONSundefined, so lastAction stops considering transaction-thread activity and the LHN preview/unread state can remain stale until the child report record is later hydrated. The previous code path used the derived thread ID directly and did not depend on loading the full child report first.
Useful? React with 👍 / 👎.
Details
This PR scopes REPORT_ACTIONS subscription to per-row level in LHNOptionsList
Fixed Issues
$ #83911
Tests
(The main improvement here is that FlashList is not recreating all items because of the reportItems, only items affected by data/reportAttributes will be recreated)
Offline tests
N/A
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)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
Details