Repository navigation
fix: App crashes when opening a transaction from a report preview after restarting the app - #105472
Conversation
…er restarting the app
|
@marufsharifi 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] |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d75188c27f
ℹ️ 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: HybridAppScreen.Recording.2026-11-04.at.7.18.27.PM.movAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safari |
|
@dmkt9, the main flow doesn't work. Screen_Recording_20261030_155025_Expensify.mp4 |
|
@dmkt9, could you please add me to the conversation where you have been asked to open a PR for this? I'm a bit confused and would appreciate some additional context. Thanks! |
@marufsharifi I'm not sure. You're using the production app in the video, right? @mountiny Could you please trigger an ad-hoc build for this PR? |
|
🚧 mountiny has triggered a test Expensify/App build. You can view the workflow run here. |
This comment has been minimized.
This comment has been minimized.
|
@dmkt9, Gentle bump. thanks. |
@marufsharifi you mean this one, right? https://expensify.slack.com/archives/C049HHMV9SM/p1793250635523749 |
|
@dmkt9, could you please merge the main. thanks. |
|
@dmkt9, the bug seems to be fixed on latest main. it is not reproducible for me anymore. could you please check again. thanks. Screen.Recording.2026-11-04.at.7.35.27.PM.mov |
|
@marufsharifi we can also monitor sentry if that is the case |
@marufsharifi Commit bc5e11d made We can apply this patch to verify it: onPreviewPressed={() => {
openTransactionFromPreview(item).catch((error: unknown) => {
console.error('openTransactionFromPreview failed', error);
});
}}@mountiny Since the fix is quite simple, I still suggest we merge this PR. What do you think? |
|
Hmm so what is the user impact now? Not sure if we need to make any changes if there are no console errors or user facing issues |
|
@dmkt9, could you please check: #105472 (comment). thanks. |
@mountiny @marufsharifi I am no longer able to reproduce the bug on production |
|
@dmkt9 @marufsharifi can you check if this is still reported in Sentry? |
@mountiny I just saw the crash reported again on Sentry. The root cause is the same, but this time it occurs in Our PR patches both places. App/src/components/ReportActionItem/MoneyRequestReportPreview/index.tsx Lines 178 to 181 in 0c6da40 |
|
ok, let move ahead with this pr then |
QA steps miss the path that still crashesOn Update QA steps to:
|
Reviewer Checklist
Screenshots/VideosAndroid: HybridApptest1.movtest2.movAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safari |
Root cause: rspack drops
|
mkhutornyi
left a comment
There was a problem hiding this comment.
The root cause seems to be in rspack but as long as the fix works, I won't block on this.
We can consider global fix as followup.
|
@mkhutornyi Thanks for the detailed review. I've switched to using |
|
Perfect, thanks. @mountiny all yours |
|
I ran the adhoc for testing |
|
🚧 mountiny has triggered a test Expensify/App build. You can view the workflow run here. |
This comment has been minimized.
This comment has been minimized.
|
Regression was completed No issues were found |
|
🚧 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! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/mountiny in version: 9.5.52-1 🚀
|
Explanation of Change
Rspack 2.1.3 drops optional chaining guards from member accesses following inlined
require()calls, causing native crashes when imported refs are null.Enable SWC’s
transform-optional-chainingin the native loader to convert optional chains into explicit null checks before Rspack processes them. This fixes affected call sites globally while preserving lazy imports.Fixed Issues
$ #105394
PROPOSAL:
Tests
Same as QA Steps
Offline tests
Same as QA Steps
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)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.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.hybrid.mp4