You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Due for payment 2026-08-25] Android & iOS - App crashes after interacting with pop-up modal #98691
Version Number: 9.4.54-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: - Email or phone of affected tester (no customers):sdsiodjnosdjiodsj@gmail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: iPhone 15 Pro Max / iOS 26.5.2 App Component: Money Requests
👋 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:
Identify the pull request that introduced this issue and revert it.
Classification: Frontend bug Causing PR: #97678 - "Fix keyboard focus not returning to FAB and composer + after Back" by @Krishna2323 (High confidence) Related Issues: None
Recommendation: ROLL FORWARD
The crash is caused by a single unguarded block that references the web-only globals HTMLElement and document in a shared (non-.web) modal file, so it throws on native the moment any modal closes. A one-line platform guard is far smaller and safer than reverting a 14-file focus-management PR, and a revert would reintroduce the focus-return bug #97678 fixed. A clean revert is an acceptable fallback if a quick guard cannot be landed.
Assigned: @Krishna2323 (PR author), @JS00001 and @mkhutornyi (approving reviewers) from the highest-confidence causing PR Labels: No change. This is a Frontend bug (App PR must be fixed/reverted), so DeployBlockerCash stays. DeployBlocker was not present. The App deploy remains blocked.
📋 Detailed Analysis
Evidence
Symptom profile matches a native-only regression exactly: crashes on Android App + iOS App only (not mWeb/web), reproduces on staging but not production, and happens with any pop-up modal — pointing at the shared modal close path rather than the Categories feature itself.
Comparing production...staging for the 9.4.54-0 release, the only shared modal-rendering change with a native-hostile diff is in src/components/Modal/ReanimatedModal/index.tsx.
The crash fires in the modal-close branch (!isVisible && isContainerOpen && !isTransitioning), i.e. "after interacting with a pop-up modal" — tapping Delete closes the confirm modal and triggers the throw.
Root Cause
PR #97678 replaced an unconditional blurActiveElement() call with a guarded version:
HTMLElement and document are web-only DOM globals. On native (Hermes) HTMLElement is not a defined variable, so evaluating container instanceof HTMLElement throws ReferenceError: Can't find variable: HTMLElement and crashes the app whenever a modal closes. The same file already demonstrates the correct approach a few lines above (L98–L112), where document access is gated behind getPlatform() === CONST.PLATFORM.WEB. The fix is to gate this new block the same way (or typeof HTMLElement !== 'undefined'), or move it into a .web variant.
This bug looks like a recurring, mechanically detectable pattern, so it may be worth a coding-standards rule so the AI reviewer catches the next one. Proposed for Expensify/App:
Rule:CONSISTENCY-18 No web-only DOM globals in shared native code
Condition: Flag references to web-only globals (HTMLElement, document, window, navigator, instanceof HTMLElement) in a file that is not *.web.ts(x) unless the access is behind a platform guard (getPlatform() === CONST.PLATFORM.WEB / Platform.OS === 'web'). Guard it, or move the logic into a .web variant.
Why: These globals are undefined on native (Hermes); evaluating them throws ReferenceError and crashes the app. Here it crashed on close of every modal (#98691, PR #97678).
Search pattern:grep -rnE '\b(HTMLElement|document|window|navigator)\b' src --include='*.tsx' --include='*.ts' | grep -v '\.web\.' then check each hit is inside a WEB platform guard.
This is distinct from CONSISTENCY-1 (which targets platform-branch maintainability, not native crashes from web-only globals). The full rule file, with ❌/✅ code inline in App's coding-standards format, would go in Expensify/App itself; a maintainer can open it there as a draft PR if it's worth adding.
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.54-4 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-08-25. 🎊
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]. If no checklist is needed for this issue, you can click: [no checklist button]
changed the title [-]Android & iOS - App crashes after interacting with pop-up modal[/-][+][Due for payment 2026-08-25] Android & iOS - App crashes after interacting with pop-up modal[/+]on Aug 18, 2026
Activity
applause-bot commentedon Aug 14, 2026
While Applause doesn't embed attachments for this bug, here are the links for quick view:
https://platform.applause.com/services/links/v1/external/749e8065ef3dc848996a7a9cdf0eb81e6b3aa239827077f30e372f7eb754e656
https://platform.applause.com/services/links/v1/external/ae1566c0219e3d8158719d0e1ab1bd4edb587f387424f08f3282b7326fffe2a4
melvin-bot commentedon Aug 14, 2026
Triggered auto assignment to @blimpich (
DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.melvin-bot commentedon Aug 14, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon Aug 14, 2026
👋 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:
MelvinBot commentedon Aug 14, 2026
🔍 Investigation Summary
Classification: Frontend bug
Causing PR: #97678 - "Fix keyboard focus not returning to FAB and composer + after Back" by @Krishna2323 (High confidence)
Related Issues: None
Recommendation: ROLL FORWARD
The crash is caused by a single unguarded block that references the web-only globals
HTMLElementanddocumentin a shared (non-.web) modal file, so it throws on native the moment any modal closes. A one-line platform guard is far smaller and safer than reverting a 14-file focus-management PR, and a revert would reintroduce the focus-return bug #97678 fixed. A clean revert is an acceptable fallback if a quick guard cannot be landed.Assigned: @Krishna2323 (PR author), @JS00001 and @mkhutornyi (approving reviewers) from the highest-confidence causing PR
Labels: No change. This is a Frontend bug (App PR must be fixed/reverted), so
DeployBlockerCashstays.DeployBlockerwas not present. The App deploy remains blocked.📋 Detailed Analysis
Evidence
production...stagingfor the 9.4.54-0 release, the only shared modal-rendering change with a native-hostile diff is insrc/components/Modal/ReanimatedModal/index.tsx.8104136("Blur only focus inside the closing modal instead of tracking the trap's focus return") is part of PR Fix keyboard focus not returning to FAB and composer + after Back #97678, merged 2026-08-14 — the same day this blocker was filed.Verification
src/components/Modal/ReanimatedModal/index.tsx, whichBaseModal.tsxrenders unconditionally for every modal on all platforms.gh api .../commits/8104136shows the exact+ if (container instanceof HTMLElement && container.contains(document.activeElement))hunk).!isVisible && isContainerOpen && !isTransitioning), i.e. "after interacting with a pop-up modal" — tapping Delete closes the confirm modal and triggers the throw.Root Cause
PR #97678 replaced an unconditional
blurActiveElement()call with a guarded version:HTMLElementanddocumentare web-only DOM globals. On native (Hermes)HTMLElementis not a defined variable, so evaluatingcontainer instanceof HTMLElementthrowsReferenceError: Can't find variable: HTMLElementand crashes the app whenever a modal closes. The same file already demonstrates the correct approach a few lines above (L98–L112), wheredocumentaccess is gated behindgetPlatform() === CONST.PLATFORM.WEB. The fix is to gate this new block the same way (ortypeof HTMLElement !== 'undefined'), or move it into a.webvariant.Offending code: ReanimatedModal/index.tsx#L147-L153
💡 Suggested AI code review rule
This bug looks like a recurring, mechanically detectable pattern, so it may be worth a coding-standards rule so the AI reviewer catches the next one. Proposed for
Expensify/App:CONSISTENCY-18No web-only DOM globals in shared native codeHTMLElement,document,window,navigator,instanceof HTMLElement) in a file that is not*.web.ts(x)unless the access is behind a platform guard (getPlatform() === CONST.PLATFORM.WEB/Platform.OS === 'web'). Guard it, or move the logic into a.webvariant.ReferenceErrorand crashes the app. Here it crashed on close of every modal (#98691, PR #97678).grep -rnE '\b(HTMLElement|document|window|navigator)\b' src --include='*.tsx' --include='*.ts' | grep -v '\.web\.'then check each hit is inside a WEB platform guard.getPlatform() === CONST.PLATFORM.WEB)This is distinct from
CONSISTENCY-1(which targets platform-branch maintainability, not native crashes from web-only globals). The full rule file, with ❌/✅ code inline in App's coding-standards format, would go inExpensify/Appitself; a maintainer can open it there as a draft PR if it's worth adding.m-natarajan commentedon Aug 15, 2026
Honor x6b / Android 16 and iPhone
Not Repro
9.4.54-1
document_4900429084825224967.mp4
ScreenRecording_08-15-2026.06-16-15_1.MP4
m-natarajan commentedon Aug 15, 2026
Issue fixed and closing as per this comment
melvin-bot commentedon Aug 18, 2026
@Krishna2323 / @mkhutornyi
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.54-4 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-08-25. 🎊
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]. If no checklist is needed for this issue, you can click: [no checklist button]
[-]Android & iOS - App crashes after interacting with pop-up modal[/-][+][Due for payment 2026-08-25] Android & iOS - App crashes after interacting with pop-up modal[/+]