fix QBD - Application crashes when try to connect QBD#79511
fix QBD - Application crashes when try to connect QBD#79511francoisl merged 1 commit intoExpensify:mainfrom
Conversation
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@hoangzinh 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 shouldShowError = hasError; | ||
|
|
||
| const children = ( |
There was a problem hiding this comment.
❌ PERF-4 (docs)
The children JSX element is not memoized and is passed to the memoized FullPageOfflineBlockingView component. Since the parent component is not optimized by React Compiler, this creates a new React element on every render, breaking memoization and causing unnecessary re-renders.
Suggested fix: Wrap the children declaration with useMemo:
const children = useMemo(() => (
<>
{shouldShowError && (
// ... existing JSX
)}
{!shouldShowError && (
// ... existing JSX
)}
</>
), [shouldShowError, hasResultOfFetchingSetupLink, codatSetupLink, styles, translate, illustrations, environmentURL, policyID]);There was a problem hiding this comment.
I think react compiler already auto memoize this. So false alarm
|
Reassigning to @aimane-chnaif as discussed in https://expensify.slack.com/archives/C02NK2DQWUX/p1768346037487499 since this is for a deploy blocker |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppandroid.movAndroid: mWeb Chromemchrome.moviOS: HybridAppios.moviOS: mWeb Safarimsafari.movMacOS: Chrome / Safariweb.mov |
francoisl
left a comment
There was a problem hiding this comment.
Thanks for the quick review!
fix QBD - Application crashes when try to connect QBD (cherry picked from commit 7151e41) (cherry-picked to staging by francoisl)
|
✋ 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/francoisl in version: 9.3.0-7 🚀
|
|
🚀 Deployed to production by https://github.com/francoisl in version: 9.3.0-8 🚀
|
|
🚀 Cherry-picked to staging by https://github.com/francoisl in version: 9.3.1-0 🚀
|
|
🚀 Deployed to production by https://github.com/francoisl in version: 9.3.1-1 🚀
|
Explanation of Change
The offending PR is #79286.
The root cause is related to react compiler.
The culprit is here:
App/src/pages/workspace/accounting/qbd/QuickBooksDesktopSetupPage.tsx
Lines 41 to 43 in b0ad823
Crash log:
I updated code like this:
Before:
After:
Fixed Issues
$ #79454
Tests
Precondition: Control workspace with enabled Accounting.
Offline tests
Same as Tests
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
Screen.Recording.2026-01-14.at.3.21.41.AM.mov