[No QA] fix: Remove duplicate useOnyx subscription and redundant hook call in LHN#86956
Conversation
| const {shouldUseNarrowLayout} = useResponsiveLayout(); | ||
| const [isLoadingReportData = true] = useOnyx(ONYXKEYS.IS_LOADING_REPORT_DATA); | ||
|
|
||
| useConfirmReadyToOpenApp(); |
There was a problem hiding this comment.
useConfirmReadyToOpenApp() is already called in BaseSidebarScreen (the parent component), so this was a duplicate invocation. The hook only needs to run once per screen.
There was a problem hiding this comment.
I missed that in the description, sorry haha
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safari |
|
🚧 @JS00001 has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/JS00001 in version: 9.3.52-0 🚀
Bundle Size Analysis (Sentry): |
|
This PR is a pure internal performance optimization (removing a duplicate Onyx subscription and a redundant hook call in the LHN render path). There are no user-facing changes — no new features, UI changes, or modified behavior. No help site documentation changes are required. |
|
🚀 Deployed to production by https://github.com/roryabraham in version: 9.3.52-9 🚀
|
Explanation of Change
Two redundant calls were removed from the LHN render path:
OptionRowLHNDatahad twouseOnyxcalls subscribing to the same Onyx key (COLLECTION.REPORT_ACTIONS${reportID}): one at line 49 (reportActions) and one at line 121 (fullReportActions). BecausereportID === fullReport?.reportIDin all cases, both subscriptions pointed to the same key. The second subscription was removed and the existingreportActionsvariable is passed instead. This saves one Onyx subscription per visible LHN row.SidebarLinkscalleduseConfirmReadyToOpenApp()which is already called in its parent componentBaseSidebarScreen. The duplicate call inSidebarLinkswas unnecessary and has been removed.Fixed Issues
$ #86962
Tests
Offline tests
N/A
QA Steps
Same as tests
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))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