Skip to content

[Due for payment 2026-03-19] Expense - App crashes when deleting expense, or blank page opens #84966

Closed

Description

@lanitochka17

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 9.3.36-0
Reproducible in staging?: Yes
Reproducible in production?: No
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #82510
Email or phone of affected tester (no customers): sdoisjdnosjiodisoj2@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Mac 26.2 / Chrome
App Component: Money Requests

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to workspace chat.
  3. Create an expense.
  4. Right click on the preview > Delete.
  5. Click Refresh.
  6. Open the report.
  7. Click More > Delete.

Expected Result:

In Step 4, app will not crash.
In Step 7, delete modal will open.

Actual Result:

In Step 4, app crashes when trying to delete expense from context menu.
In Step 7, blank page opens.

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari

Screenshots/Videos

Bug7100341_1773260688404.1.mp4

Bug7100341_1773260688404!staging.new.expensify.com-1773257823038.txt

View all open jobs on GitHub

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    on Mar 11, 2026
  2. melvin-bot commented on Mar 11, 2026

    @melvin-bot

    You have been assigned to this deploy blocker because you recently merged this PR: #82510

  3. melvin-bot commented on Mar 11, 2026

    @melvin-bot

    💬 A slack conversation has been started in #expensify-open-source

  4. github-actions commented on Mar 11, 2026

    @github-actions
    Contributor

    👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  5. OSBotify commented on Mar 11, 2026

    @OSBotify
    Contributor

    Investigation Summary

    Classification: Frontend bug
    Causing PR: #82510 - "fix: Screen Reader: Many Pages: There is no dialog role and title announced" by @TaduJR (High confidence)
    Related Issues: None

    Recommendation: REVERT

    PR #82510 should be reverted. The PR introduces accessibility improvements for screen readers by wrapping RightModalNavigator with DialogLabelProvider and modifying the Header component to register itself with this context. However, the DialogLabelProvider is only available within the RightModalNavigator, while Header components are used throughout the app in many other navigators and pages.

    Labels: No label changes needed - issue is only reproducible on staging, not production, so DeployBlockerCash label is appropriate.

    Detailed Analysis

    Evidence

    Root Cause

    PR #82510 made the following changes:

    1. Created a new DialogLabelContext with DialogLabelProvider
    2. Wrapped only the RightModalNavigator with DialogLabelProvider (lines 203-435 of RightModalNavigator.tsx)
    3. Modified Header.tsx to ALWAYS call useDialogLabelActions() hook (line 41)

    The Problem: Header components are rendered in many places throughout the app:

    • UpdateRequiredView (src/pages/ErrorPage/UpdateRequiredView.tsx line 30)
    • Various modal navigators
    • Full-screen navigators
    • Central pane screens
    • Context menus and popovers

    When a Header is rendered OUTSIDE of the RightModalNavigator, it tries to use useDialogLabelActions() but the DialogLabelProvider context is not available. While the default context returns isInsideDialog: false (which should work), the Header component now includes:

    • useEffect hooks that interact with the context (lines 46-55, 57-58, 61-70 in Header.tsx)
    • Refs (labelIdRef, titleRef) that are managed based on context state
    • Focus management via useDialogTitleFocus

    These additions can cause crashes or rendering issues when:

    1. The context changes unexpectedly during navigation
    2. Cleanup functions run during unmount in non-RHP contexts
    3. Multiple Headers mount/unmount rapidly (as happens during delete flows)

    The crash when deleting an expense from the context menu likely occurs because the delete action involves:

    1. Opening a delete confirmation modal (ConfirmModal)
    2. Navigating/updating UI state
    3. Multiple Headers mounting/unmounting in quick succession
    4. Context cleanup functions running in an unexpected order

    Verification

  6. MelvinBot commented on Mar 11, 2026

    @MelvinBot
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    The app crashes when trying to delete an expense from the context menu (right-click on expense preview > Delete), and after refreshing, clicking More > Delete on the report shows a blank page instead of a delete confirmation modal.

    What is the root cause of that problem?

    PR #82510 introduced useDialogTitleFocus in Header.tsx (line 58), which internally calls useNavigation() unconditionally at the top of the hook (src/hooks/useDialogTitleFocus/index.ts:16).

    The Header component is used inside ConfirmContent (src/components/ConfirmContent.tsx:190), which is rendered by ConfirmModal. There are two key places where ConfirmModal is rendered outside the NavigationContainer:

    1. PopoverReportActionContextMenu — rendered in Expensify.tsx at line 296 as a sibling to NavigationRoot, not a child of it. When the user right-clicks an expense and clicks "Delete", the delete confirmation modal shows a Header → calls useDialogTitleFocus → calls useNavigation() → throws "Couldn't find a navigation object" → app crashes.

    2. ModalProvider — renders its modal component (e.g., ConfirmModalWrapper) as a sibling of its children in App.tsx line 132, also outside the NavigationContainer. This is the path for "More > Delete" which uses useConfirmModal, hitting the same crash.

    Before PR #82510, Header never called useNavigation(), so rendering it outside the navigation tree was fine. The PR added the call unconditionally, breaking all Header instances that render outside the navigation context.

    What changes do you think we should make in order to solve the problem?

    In src/hooks/useDialogTitleFocus/index.ts, guard the useNavigation() call so it doesn't throw when Header is rendered outside a navigator. Two approaches:

    Option A (preferred): Check the navigation context manually before using it. Replace the direct useNavigation() call with a safe wrapper that returns undefined when no navigation context is available (e.g., read NavigationContext via useContext and only proceed if it's defined). Then guard the useEffect body on navigation being defined.

    Option B: Since useDialogTitleFocus already receives isInsideDialog (which is false when outside the DialogLabelProvider), early-return before the useEffect body. However, useNavigation() at line 16 is called unconditionally at the hook's top level regardless of isInsideDialog, so the hook itself needs to stop calling useNavigation() when navigation context is unavailable.

    What alternative solutions did you explore? (Optional)

    • Moving PopoverReportActionContextMenu inside the NavigationContainer — this would be a larger structural change and might have unintended side effects on modal stacking behavior.
    • Wrapping useNavigation() in a try-catch — this works but is less idiomatic than checking the context directly.
    • Making useDialogTitleFocus a no-op when isInsideDialog is false — still requires the hook to not call useNavigation() unconditionally, since React hooks can't be called conditionally.

    Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.

  7. melvin-bot commented on Mar 12, 2026

    @melvin-bot

    ⚠️ Looks like this issue was linked to a Deploy Blocker here

    If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

    If a regression has occurred and you are the assigned CM follow the instructions here.

    If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

  8. 7 remaining items

  9. melvin-bot commented on Mar 12, 2026

    @melvin-bot

    ⚠️ Looks like this issue was linked to a Deploy Blocker here

    If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

    If a regression has occurred and you are the assigned CM follow the instructions here.

    If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

  10. melvin-bot commented on Mar 12, 2026

    @melvin-bot

    ⚠️ Looks like this issue was linked to a Deploy Blocker here

    If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

    If a regression has occurred and you are the assigned CM follow the instructions here.

    If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

  11. melvin-bot commented on Mar 12, 2026

    @melvin-bot

    ⚠️ Looks like this issue was linked to a Deploy Blocker here

    If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

    If a regression has occurred and you are the assigned CM follow the instructions here.

    If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

  12. melvin-bot commented on Mar 12, 2026

    @melvin-bot

    ⚠️ Looks like this issue was linked to a Deploy Blocker here

    If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

    If a regression has occurred and you are the assigned CM follow the instructions here.

    If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

  13. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on Mar 12, 2026
  14. changed the title [-]Expense - App crashes when deleting expense, or blank page opens[/-] [+][Due for payment 2026-03-19] Expense - App crashes when deleting expense, or blank page opens[/+] on Mar 12, 2026
  15. melvin-bot commented on Mar 12, 2026

    @melvin-bot

    Reviewing label has been removed, please complete the "BugZero Checklist".

  16. melvin-bot commented on Mar 12, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.36-10 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

    If no regressions arise, payment will be issued on 2026-03-19. 🎊

  17. melvin-bot commented on Mar 12, 2026

    @melvin-bot

    @amyevans The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

  18. melvin-bot commented on Mar 12, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.EngineeringWeeklyKSv2

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions