fix: app crash when navigation away from PDF view#82628
Conversation
|
|
757e455 to
608ff58
Compare
|
I can start the review in a few hours |
|
🚧 @francoisl has triggered a test Expensify/App build. You can view the workflow run here. |
This comment has been minimized.
This comment has been minimized.
|
@suneox Could you please test using the build above? |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAdhoc screen-20260218-101633.1.mp4Local CleanShot.2026-02-18.at.10.21.43.1.mp4Android: mWeb ChromeNot available iOS: HybridAppNot available iOS: mWeb SafariNot available MacOS: Chrome / SafariNot available |
I've verified this on both AdHoc and local builds, and it works as expected. |
|
We did not find an internal engineer to review this PR, trying to assign a random engineer to #82570 as well as to this PR... Please reach out for help on Slack if no one gets assigned! |
|
🚧 @mountiny has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
✋ 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/mountiny in version: 9.3.23-2 🚀
|
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.3.23-3 🚀
|
Explanation of Change
This patch fixes a fatal Android crash (java.lang.IllegalStateException: Already closed) that occurs when users navigate away from a PDF while it's still rendering.
The crash is caused by a race condition between the background rendering thread and the main thread during component unmount. The fix sets AlreadyClosedBehavior.IGNORE via pdfiumandroid's global config, so that attempts to close already-closed resources are silently ignored instead of throwing.
Fixed Issues
$ #82570
PROPOSAL: #82570 (comment)
Tests
Offline tests
Same as test above
QA Steps
Same as test above
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
2026-02-17.17.01.09.mp4
Android: mWeb Chrome
N/A
iOS: Native
N/A
iOS: mWeb Safari
N/A
MacOS: Chrome / Safari
N/A