[Due for payment 2026-11-30] [$175] Android – App crashes when opening a transaction from a report preview after restarting the app.
If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.
Version Number: 9.5.25-0 Reproducible in staging?: Y Reproducible in production?: Y If this was caught during regression testing, add the test name, ID and link from BrowserStack: Email or phone of affected tester (no customers): Logs: https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by: @dmkt9 Slack conversation (hyperlinked to channel name): #Expensify Bugs
Action Performed:
- Open the Android app.
- Navigate to a workspace chat containing a report with at least two transactions.
- Fully close the app.
- Reopen the app.
- Once the app has fully loaded, tap the report preview to open a transaction.
Expected Result:
The transaction report opens successfully.
Actual Result:
The app crashes.
Workaround:
Unknown
Platforms:
Select the officially supported platforms where the issue was reproduced:
- [x] Android: App
- [ ] Android: mWeb Chrome
- [ ] iOS: App
- [ ] iOS: mWeb Safari
- [ ] iOS: mWeb Chrome
- [ ] Windows: Chrome
- [ ] MacOS: Chrome / Safari
Note:
crash occurs here: https://github.com/Expensify/App/blob/2a41126adf50ac064cc1956926538aba203c2603/src/components/ReportActionItem/MoneyRequestReportPreview/index.tsx#L333-L335 if (contextMenuRef.current?.isContextMenuOpening) { return; }It looks like contextMenuRef.current changes from a value → null → a value during hydration, so it may become null after the null check. When I capture the ref in a local variable instead, the crash disappears: const contextMenu = contextMenuRef.current; if (contextMenu?.isContextMenuOpening) { return; }
Screenshots/Videos
https://github.com/user-attachments/assets/3a0173b6-b4b4-4567-97e2-542e1f9eaca3
https://github.com/user-attachments/assets/56a10764-931a-4c9d-b783-75dba6f96236
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~022115827795513184215
- Upwork Job ID: 2115827795513184215
- Last Price Increase: 2026-10-29
Issue Owner
Current Issue Owner: @mallenexpensify
⚠️ Preliminary analysis (low confidence) — treat as a starting point, not a conclusion.
I think the crash happens on the screen the tap opens, not in the tap handler. After a restart, the expense report's IOU action isn't in Onyx yet. So openTransactionFromPreview does three things at once:
- Writes a bare-bones transaction thread with no
parentReportActionID(resolveChildReportID). - Calls
openReportfor the expense report. - Pushes two screens in the same tick (
navigateToExpense).
The destination lists then mount and change type while data is still loading. On Android, a likely failure point is the native scroll manager. Its scrollToIndex has no range or layout guard (useReportScrollManager/index.native.ts:13-31).
I wasn't able to verify this. The issue has no stack trace, and I can't run the Android app here. The tap path itself has no throw, non-null assertion, or unguarded scrollToIndex.
To confirm, check:
- The Android logcat or Sentry stack for this crash. It shows whether this is a JS fatal or a native crash (react-native-screens or FlashList).
- Whether it still crashes if you open the expense report once before restarting. If it doesn't, the missing IOU action is the trigger.
Recent PRs in this path (all in 9.5.24)
- [No QA] Disallow manual memoization in compiled React code removed
useCallback/useMemo/memofrom the preview, carousel, andTransactionPreview. The timing fits best, but I found no crash path in it. - Fix action pill flashing when sending messages changed the native-only scroll manager and briefly dropped the optional call on
getNativeScrollRef. A later PR restored it on 10-29. Worth retesting on a build that includes that PR.
Possibly related: Expense - Split preview loads infinitely and opens not here page after reset app. It also fails when opening from a preview after a reset.
Next Steps: Reply with @MelvinBot <your feedback> to refine this analysis. A crash stack trace would help most.
Triggered auto assignment to Contributor-plus team member for initial proposal review - @marufsharifi (External)
Job added to Upwork: https://www.upwork.com/jobs/~022115827795513184215
Proposal
Audit verdict: insufficient evidence for a defensible fix proposal. No root cause, TypeScript patch, or passing regression test has been verified.
Please re-state the problem that we are trying to solve in this issue.
On Android version 9.5.25-0, opening a transaction through a report preview after fully closing and reopening the app reportedly crashes the application. The transaction report should open successfully.
What is the root cause of that problem?
Undetermined. The supplied material contains reproduction steps but no source snippets, exception message, stack trace, or reproducible test fixture.
During verification:
- No Expensify checkout was found in the workspace.
- The linked crash logs and video attachments could not be retrieved.
- The affected version’s source could not be retrieved.
- The original GitHub issue and its existing proposals were not located, leaving duplicate and prior-fix status unverified.
Cold-start state hydration, stale transaction references, navigation restoration, and native rendering failures are investigation hypotheses only. The restart dependency does not establish any of them.
Exact source paths and line numbers cannot be responsibly attributed without inspecting the affected revision and correlating it with the crash.
What changes do you think we should make in order to solve the problem?
No production change is justified yet. An exact TypeScript diff here would fabricate both the failing code and the necessary correction.
The minimum evidence needed to select a surgical fix is:
- Reproduce on
9.5.25-0and record the Android version, build identifier, and exact app-termination method. - Capture timestamped
adb logcatoutput covering termination, relaunch, preview selection, and failure. Obtain a symbolicated JavaScript stack or native crash trace as applicable. - Trace the exception to the affected source revision and preserve the smallest sanitized state fixture that reproduces it.
- Add a regression test that fails for the observed reason before applying the smallest corrective change.
Expensify’s contribution guidelines require reproduction before proceeding with a proposal.
What alternative solutions did you explore? (Optional)
No MelvinBot proposal was supplied, so there is no specific implementation to rebut.
Blanket optional chaining, swallowed exceptions, startup delays, and clearing persisted storage lack demonstrated justification. They could suppress symptoms, leave navigation broken, or remove state without correcting the cause.
There is also no evidence supporting a security classification or CVSS score.
What automated tests can you add to prevent this from re-occurring?
Proposed coverage; not implemented or executed:
- Android lifecycle regression: create a report with two distinct transactions, terminate and relaunch the app using the reproduced termination method, open each transaction through the preview, and verify the correct transaction renders and remains usable.
- Targeted Jest regression: once the failing function or component is identified, replay the captured state and event sequence. Assert successful navigation and the correct transaction identifier. Demonstrate failure before the patch and success afterward.
A Jest test alone cannot establish that an Android native process crash is fixed; device or emulator verification remains necessary.
Contributor details
Your Expensify account email: [email protected]
Upwork Profile Link: https://www.upwork.com/freelancers/~01b60d704ba377be83
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
Proposal
Please re-state the problem that we are trying to solve in this issue.
On Android, after force-closing and reopening the app in a workspace chat that contains an expense report with multiple transactions, tapping a transaction card inside the report preview crashes the app instead of opening the transaction thread report.
What is the root cause of that problem?
There are two parts to why this happens during cold-start hydration on Android:
-
Why
contextMenuRef.currentrepeatedly flipsvalue -> null -> valueduring hydration: Insrc/GlobalModals.tsx:31-62,LazyPopoverReportActionContextMenuis mounted withref={ReportActionContextMenu.contextMenuRef}. Insidesrc/pages/inbox/report/ContextMenu/PopoverReportActionContextMenu.tsx:64-105and348-388,PopoverReportActionContextMenusubscribes to several global Onyx collections (ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS,ONYXKEYS.DERIVED.VISIBLE_REPORT_ACTIONS,ONYXKEYS.BANK_ACCOUNT_LIST,ONYXKEYS.SELF_DM_REPORT_ID, etc.) and is skipped by React Compiler because it readsreportIDRef.currentandreportActionRef.currentduring render. Atsrc/pages/inbox/report/ContextMenu/PopoverReportActionContextMenu.tsx:500-512,useImperativeHandle(ref, () => ({ ... }))is called without a dependency array. In React's commit phase, whenever an effectfuluseImperativeHandlewithout stable dependencies re-runs on a render, React first detaches the ref in the mutation phase (safelyDetachRefsetscontextMenuRef.current = null) before attaching the newly created handle object in the layout phase (commitAttachRef). Because cold-start hydration after an app restart triggers a stream of Onyx updates across those global subscriptions,contextMenuRef.currentrepeatedly cyclesvalue -> null -> value. -
Why
MoneyRequestReportPreviewcrashes on press: Insrc/pages/inbox/report/ContextMenu/ReportActionContextMenu.ts, all other consumers interact withcontextMenuRefthrough helper functions, whereassrc/components/ReportActionItem/MoneyRequestReportPreview/index.tsxdirectly accessescontextMenuRef.current?.isContextMenuOpeninginopenReportFromPreview(line 174) andopenTransactionFromPreview(line 333). After PR #104522 removed manualuseCallbackmemoization inMoneyRequestReportPreview/index.tsxso it is compiled by React Compiler (and lowered throughcjs-inline-requires-loader.mjson native), evaluatingcontextMenuRef.current?.isContextMenuOpeningdirectly on the imported binding during cold-start hydration crashes on Android unlesscontextMenuRef.currentis captured in a local variable first.
What changes do you think we should make in order to solve the problem?
- In
src/components/ReportActionItem/MoneyRequestReportPreview/index.tsx, captureconst contextMenu = contextMenuRef.current;in a local variable before checkingcontextMenu?.isContextMenuOpeningin bothopenReportFromPreview(lines 173-176) andopenTransactionFromPreview(lines 332-335):
const openReportFromPreview = () => {
const contextMenu = contextMenuRef.current;
if (!iouReportID || contextMenu?.isContextMenuOpening) {
return;
}
and:
const openTransactionFromPreview = (transaction: Transaction) => {
const contextMenu = contextMenuRef.current;
if (contextMenu?.isContextMenuOpening) {
return;
}
(Alternatively, we can export a small helper function isContextMenuOpening(): boolean from src/pages/inbox/report/ContextMenu/ReportActionContextMenu.ts that captures const contextMenu = contextMenuRef.current; return !!contextMenu?.isContextMenuOpening; and call isContextMenuOpening() in both handlers so MoneyRequestReportPreview does not need to touch contextMenuRef.current directly.)
- Optionally, to stop
contextMenuRef.currentfrom detaching tonullon every background render ofPopoverReportActionContextMenuwhen the popover is closed, we can also storeisContextMenuOpeningin a ref (or keep the imperative handle methods reading from refs with a stableuseImperativeHandle(ref, () => ({ ... }), [ ... ])) insrc/pages/inbox/report/ContextMenu/PopoverReportActionContextMenu.tsx, sinceisContextMenuOpeningis never read in JSX.
What alternative solutions did you explore? (Optional)
Waiting for contextMenuRef.current to be non-null before allowing preview presses would block opening reports/transactions during the initial 2-second idle deferral window (IDLE_CALLBACK_TIMEOUT_MS in GlobalModals.tsx) when the context menu has not even been mounted yet. Capturing const contextMenu = contextMenuRef.current locally in openReportFromPreview and openTransactionFromPreview safely treats an unmounted or mid-commit ref as not opening while avoiding the Android crash.
Proposal
Please re-state the problem that we are trying to solve in this issue.
On Android, after force-closing and restarting the app in a workspace chat that contains an expense report with multiple transactions, tapping a transaction card in the report preview causes the app to crash instead of opening the transaction thread report.
What is the root cause of that problem?
There are three interrelated architectural and lifecycle factors causing this crash on Android:
-
Direct ref de-referencing bypassing encapsulation: Across the application,
contextMenuRefinsrc/pages/inbox/report/ContextMenu/ReportActionContextMenu.tsis strictly encapsulated behind exported helper functions (showContextMenu,hideContextMenu,isActiveReportAction,clearActiveReportAction,showDeleteModal,hideDeleteModal). Each of these helpers guards access to the underlying ref. However,src/components/ReportActionItem/MoneyRequestReportPreview/index.tsxwas the sole exception in the entire codebase, importingcontextMenuRefdirectly and evaluatingcontextMenuRef.current?.isContextMenuOpeninginline inopenReportFromPreview(line 184) andopenTransactionFromPreview(line 349). -
Un-memoized
useImperativeHandlecausingref.currentdetachment during Onyx hydration: Insrc/pages/inbox/report/ContextMenu/PopoverReportActionContextMenu.tsx:501-513,useImperativeHandle(ref, () => ({ ... }))is declared without any dependency array.PopoverReportActionContextMenusubscribes to several global Onyx collections (ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS,ONYXKEYS.DERIVED.VISIBLE_REPORT_ACTIONS,ONYXKEYS.COLLECTION.REPORT_ACTIONS, etc.). During cold-start hydration following an app restart, initial data sequentially hydrates across these subscriptions, triggering multiple successive re-renders ofPopoverReportActionContextMenu. BecauseuseImperativeHandlelacks dependencies, React commits cleanup on each render—settingref.current = nullin the mutation phase before attaching the newly created imperative handle in the layout phase. This causescontextMenuRef.currentto cyclevalue -> null -> value. -
Android Hermes runtime crash on unmemoized member de-referencing: Under React Native Android with Hermes, React Compiler, and inline module requires (
cjs-inline-requires-loader.mjs), evaluatingcontextMenuRef.current?.isContextMenuOpeningdirectly across the imported module binding while the ref is in transition or unattached leads to accessing properties on an uninitialized/null reference, terminating the process with a fatal native crash ("Expensify keeps stopping").
What changes do you think we should make in order to solve the problem?
1. Export isContextMenuOpening helper from ReportActionContextMenu.ts
In src/pages/inbox/report/ContextMenu/ReportActionContextMenu.ts, add and export the encapsulated helper function, matching isActiveReportAction and clearActiveReportAction:
--- a/src/pages/inbox/report/ContextMenu/ReportActionContextMenu.ts
+++ b/src/pages/inbox/report/ContextMenu/ReportActionContextMenu.ts
@@ -191,8 +191,16 @@ function clearActiveReportAction() {
return contextMenuRef.current.clearActiveReportAction();
}
-export {contextMenuRef, showContextMenu, hideContextMenu, isActiveReportAction, clearActiveReportAction, showDeleteModal, hideDeleteModal, registerEnsureContextMenuMounted};
+/**
+ * Whether the context menu is currently opening.
+ */
+function isContextMenuOpening(): boolean {
+ const contextMenu = contextMenuRef.current;
+ return !!contextMenu?.isContextMenuOpening;
+}
+
+export {contextMenuRef, showContextMenu, hideContextMenu, isActiveReportAction, clearActiveReportAction, showDeleteModal, hideDeleteModal, registerEnsureContextMenuMounted, isContextMenuOpening};
export type {ContextMenuType, ReportActionContextMenu, ContextMenuAnchor};
Capturing contextMenuRef.current in a local variable (const contextMenu = contextMenuRef.current) ensures the ref is read exactly once in a single evaluation step.
2. Update MoneyRequestReportPreview/index.tsx to consume isContextMenuOpening
In src/components/ReportActionItem/MoneyRequestReportPreview/index.tsx, replace direct access to contextMenuRef with the new helper:
--- a/src/components/ReportActionItem/MoneyRequestReportPreview/index.tsx
+++ b/src/components/ReportActionItem/MoneyRequestReportPreview/index.tsx
@@ -32,7 +32,7 @@ import Navigation from '@libs/Navigation/Navigation';
import {getNonEmptyStringOnyxID} from '@libs/getNonEmptyStringOnyxID';
import {getIOUActionForReportID} from '@libs/ReportActionsUtils';
import {isIOUReport} from '@libs/ReportUtils';
-import {contextMenuRef} from '@pages/inbox/report/ContextMenu/ReportActionContextMenu';
+import {isContextMenuOpening} from '@pages/inbox/report/ContextMenu/ReportActionContextMenu';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import ROUTES from '@src/ROUTES';
@@ -181,7 +181,7 @@ function MoneyRequestReportPreview({
}, []);
const openReportFromPreview = useCallback(() => {
- if (!iouReportID || contextMenuRef.current?.isContextMenuOpening) {
+ if (!iouReportID || isContextMenuOpening()) {
return;
}
@@ -346,7 +346,7 @@ function MoneyRequestReportPreview({
const openTransactionFromPreview = useCallback(
(transaction: Transaction) => {
- if (contextMenuRef.current?.isContextMenuOpening) {
+ if (isContextMenuOpening()) {
return;
}
3. Stabilize useImperativeHandle in PopoverReportActionContextMenu.tsx
In src/pages/inbox/report/ContextMenu/PopoverReportActionContextMenu.tsx, supply [isContextMenuOpening] as the dependency array so that background Onyx hydration updates do not detach and reattach the ref on every tick:
--- a/src/pages/inbox/report/ContextMenu/PopoverReportActionContextMenu.tsx
+++ b/src/pages/inbox/report/ContextMenu/PopoverReportActionContextMenu.tsx
@@ -510,7 +510,7 @@ function PopoverReportActionContextMenu({ref}: PopoverReportActionContextMenuPr
contentRef,
isContextMenuOpening,
composerToRefocusOnCloseEmojiPicker: composerToRefocusOnClose,
- }));
+ }), [isContextMenuOpening]);
const reportAction = reportActionRef.current;
What alternative solutions did you explore? (Optional)
- Capturing
const contextMenu = contextMenuRef.current;locally insideMoneyRequestReportPreview: While locally capturing the ref stops the crash, leavingcontextMenuRefexposed violates the component architecture ofReportActionContextMenu, where all callers interact through exported helper functions. ProvidingisContextMenuOpening()encapsulates the ref correctly across the codebase. - Waiting for
contextMenuRef.currentto be defined before allowing preview taps: This would introduce an artificial 2-second touch block during the idle deferral window (IDLE_CALLBACK_TIMEOUT_MSinGlobalModals.tsx) when the context menu is still lazily idle-deferred. CallingisContextMenuOpening()handles unmounted, null, or opening states cleanly with zero interaction latency.
What automated tests can you add to prevent this from re-occurring?
Add unit tests in tests/ui/MoneyRequestReportPreview.test.tsx verifying:
openTransactionFromPreviewexecutes cleanly whencontextMenuRef.currentisnull(simulating cold-start pre-hydration state).openTransactionFromPreviewsafely executes whencontextMenuRef.currenttransitions during mount.isContextMenuOpening()returnsfalsewhencontextMenuRef.currentisnullwithout throwing any runtime error.
Contributor details Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~011091133bbb09cd1c
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
Proposal
Please re-state the problem that we are trying to solve in this issue.
On Android, after force-closing and reopening the app in a workspace chat that contains an expense report with multiple transactions, tapping a transaction card in the report preview crashes the app instead of opening the transaction thread report.
What is the root cause of that problem?
- In src/GlobalModals.tsx, LazyPopoverReportActionContextMenu is mounted with ef={ReportActionContextMenu.contextMenuRef}. Inside src/pages/inbox/report/ContextMenu/PopoverReportActionContextMenu.tsx (lines 500-512), useImperativeHandle(ref, () => ({ ... })) is declared without a dependency array while the component subscribes to multiple global Onyx collections (TRANSACTION_VIOLATIONS, VISIBLE_REPORT_ACTIONS, BANK_ACCOUNT_LIST, etc.). During cold-start Onyx hydration after an app restart, each render detaches contextMenuRef.current = null in React's mutation phase before re-attaching the new handle in the layout phase.
- Unlike every other consumer of src/pages/inbox/report/ContextMenu/ReportActionContextMenu.ts (which uses encapsulated helper functions), src/components/ReportActionItem/MoneyRequestReportPreview/index.tsx imports contextMenuRef directly and evaluates contextMenuRef.current?.isContextMenuOpening in openReportFromPreview and openTransactionFromPreview. After PR #104522 enabled React Compiler on MoneyRequestReportPreview/index.tsx (combined with cjs-inline-requires-loader.mjs on Android Hermes), reading .current?.isContextMenuOpening directly across the inline-required module binding while contextMenuRef.current transitions alue -> null -> value during cold-start hydration triggers a fatal Android crash unless captured in a local variable / helper function.
What changes do you think we should make in order to solve the problem?
- In src/pages/inbox/report/ContextMenu/ReportActionContextMenu.ts, export a dedicated helper function isContextMenuOpening(): boolean that captures const contextMenu = contextMenuRef.current; return !!contextMenu?.isContextMenuOpening;.
- In src/components/ReportActionItem/MoneyRequestReportPreview/index.tsx, replace the direct contextMenuRef.current?.isContextMenuOpening checks in both openReportFromPreview and openTransactionFromPreview with isContextMenuOpening() (or capture const contextMenu = contextMenuRef.current; locally before checking contextMenu?.isContextMenuOpening).
- In src/pages/inbox/report/ContextMenu/PopoverReportActionContextMenu.tsx, stabilize useImperativeHandle so background Onyx hydration renders while the context menu is closed do not repeatedly detach and re-attach contextMenuRef.current.
What alternative solutions did you explore? (Optional)
Blocking preview presses when contextMenuRef.current is ull was ruled out because GlobalModals.tsx defers mounting LazyPopoverReportActionContextMenu via equestIdleCallback (IDLE_CALLBACK_TIMEOUT_MS = 2000), so contextMenuRef.current is legitimately ull right after startup. Capturing the ref via isContextMenuOpening() safely returns alse when unmounted or mid-hydration without blocking user taps.
Contributor details Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~010b8a98bb82c2f8e6
⚠️ Invalid email. Please make sure to create an Expensify account with this email first here.
⚠️ Invalid email. Please make sure to create an Expensify account with this email first here.
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
📣 @marufsharifi We're missing your Upwork ID to automatically send you an offer for the Reviewer role. Once you apply to the Upwork job, your Upwork ID will be stored and you will be automatically hired for future jobs!
📣 @marufsharifi We're missing your Upwork ID to automatically send you an offer for the Reviewer role. Once you apply to the Upwork job, your Upwork ID will be stored and you will be automatically hired for future jobs!
📣 @dmkt9 You have been assigned to this job! Please apply to the Upwork job and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑💻 Once you apply to this job, your Upwork ID will be stored and you will be automatically hired for future jobs! Keep in mind: Code of Conduct | Contributing 📖
Sorry, wrong issue Mariusz
(Vit's agent) Sentry tracks this crash as APP-NHA. Fresh numbers:
- Users (last 14d, production 9.5.25 to 9.5.27): 7 (9.5.25: 5, 9.5.26: 1, 9.5.27: 1)
- Users (total since first seen): 23
- First seen: 2026-10-27. It still happens on 9.5.27.
- Platform: Android HybridApp
- Error:
TypeError: Cannot read property 'isContextMenuOpening' of null, thrown from the report previewonPressatsrc/components/ReportActionItem/MoneyRequestReportPreview/index.tsx:174
Proposal
Please re-state the problem that we are trying to solve in this issue.
On Android, after force-closing and restarting the app while viewing a workspace chat that contains an expense report preview with multiple transactions, tapping a transaction card inside the report preview crashes the app (TypeError: Cannot read property 'isContextMenuOpening' of null) instead of opening the transaction thread.
What is the root cause of that problem?
- In
src/components/ReportActionItem/MoneyRequestReportPreview/index.tsx(around line 174), the transaction preview press handler directly dereferencesReportActionContextMenu.contextMenuRef.current.isContextMenuOpeningwithout optional chaining (contextMenuRef.current?.isContextMenuOpening). - In
src/GlobalModals.tsx(lines 31–62),LazyPopoverReportActionContextMenuis mounted lazily withref={ReportActionContextMenu.contextMenuRef}. On Android cold start while Onyx is hydrating large collections (TRANSACTION_VIOLATIONS,REPORT_ACTIONS, etc.),LazyPopoverReportActionContextMenueither has not finished mounting its imperative handle yet or temporarily detaches/re-attachescontextMenuRef.currentacross re-renders inPopoverReportActionContextMenu.tsx, leavingReportActionContextMenu.contextMenuRef.currentasnullwhen the user taps a transaction card inMoneyRequestReportPreview. - Dereferencing
.isContextMenuOpeningonnullthrows an unhandledTypeErroron the UI/JS thread and crashes the Android app.
What changes do you think we should make in order to solve the problem?
- In
src/components/ReportActionItem/MoneyRequestReportPreview/index.tsx(line 174) and any other callers accessingReportActionContextMenu.contextMenuRef.current, use optional chaining (Boolean(ReportActionContextMenu.contextMenuRef.current?.isContextMenuOpening)) or expose a null-safe helperisContextMenuOpening()insrc/pages/inbox/report/ContextMenu/ReportActionContextMenu.ts. - In
src/pages/inbox/report/ContextMenu/PopoverReportActionContextMenu.tsx, memoize the dependencies ofuseImperativeHandlesocontextMenuRef.currentis not needlessly torn down on unrelated Onyx collection updates during cold-start hydration.
What alternative solutions did you explore? (Optional)
We considered eagerly mounting PopoverReportActionContextMenu instead of using React.lazy in GlobalModals.tsx, but lazy loading improves startup performance, and making contextMenuRef.current access null-safe eliminates the crash without sacrificing startup bundle splitting.
📣 @jeffrey-graham! 📣 Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork. Please follow these steps:
- Make sure you've read and understood the contributing guidelines.
- Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
- Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
- Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>