Skip to content

[$250] iOS - Troubleshoot - App crashes when soft killing the app #89090

Closed

Description

@jponikarchuk

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: v9.3.64-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: https://test-management.browserstack.com/projects/2219752/folder/13176925/test-cases/41237593
Email or phone of affected tester (no customers): htad26+wjeje@gmail.com
Issue reported by: Applause Internal Team
Bug source: Regression TC Execution
Device used: iOS 26.3/iPhone 13
App Component: Other

Action Performed:

  1. Launch the app
  2. Sign in with any account
  3. Tap 4 fingers on the screen > "Soft kill the app" > Kill

Expected Result:

The app is force closed and doesn't crash

Actual Result:

The app crashes

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Video.mp4

logs.txt

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~022049143835582330631
  • Upwork Job ID: 2049143835582330631
  • Last Price Increase: 2026-05-12
Issue OwnerCurrent Issue Owner: @arosiclair

Activity

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

    @melvin-bot

    Triggered auto assignment to @marcochavezf (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

  3. github-actions commented on Apr 28, 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.
  4. melvin-bot commented on Apr 28, 2026

    @melvin-bot

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

  5. OSBotify commented on Apr 28, 2026

    @OSBotify
    Contributor

    Investigation Summary

    Classification: Frontend bug (iOS native layer — fix likely requires changes to App or Mobile-Expensify iOS native code)
    Causing PR: Unknown — no single App PR identified as the direct cause (Low confidence)
    Related Issues: None linked

    Recommendation: NEEDS INVESTIGATION

    The crash occurs in iOS-native code (NativeModules.TestToolsBridge.softKillApp()) when triggering the soft kill from the troubleshoot menu. The TestToolsBridge native module is not implemented anywhere in the App repo's iOS code, meaning the native implementation lives in the Mobile-Expensify (HybridApp) native layer. This falls outside the App repo's searchable history. Additionally, the test was performed on iOS 26.3 — which is currently a pre-release beta OS — introducing the possibility that the crash is an iOS 26 compatibility issue rather than a code regression in a specific PR.

    Assigned: @marcochavezf (auto-assigned via melvin-bot)
    Labels: DeployBlockerCash kept (iOS App crash on staging — App deploy is blocked until resolved). No label changes made.

    Detailed Analysis

    Evidence

    • The crash reproduces on staging (v9.3.64-0) only; not reproducible on production.
    • Steps: Launch app → sign in → 4-finger tap → "Soft kill the app" → Kill → crash occurs.
    • Platform: iOS only (iPhone 13, iOS 26.3).
    • The JS code path is clear: NativeModules.TestToolsBridge.softKillApp() is called from src/components/SoftKillTestToolRow/index.native.tsx.
    • TestToolsBridge is declared in src/types/modules/react-native.d.ts but the iOS native implementation is not present in any file under ios/ or modules/ in the App repo.
    • The native implementation lives in the Mobile-Expensify submodule (HybridApp), which is not checked out in this environment.
    • The test was conducted on iOS 26.3 — iOS 26 is a pre-release beta version of iOS (not publicly released). This adds significant uncertainty: the crash may be caused by a breaking API change in iOS 26 rather than a regression in a specific merged PR.

    Verification

    • Searched all files in ios/, modules/, and src/ for TestToolsBridge or softKill — no native iOS implementation found in the App repo.
    • The SoftKillTestToolRow/index.native.tsx has existed in the codebase since at least before this staging cycle (translation key softKillTheApp was added in PR [No QA] feat: add Sentry debug controls to Troubleshoot page #77254, December 2025).
    • No App repo PR in the StagingDeployCash checklist modifies SoftKillTestToolRow, TestToolsBridge, or any iOS native code related to app termination.
    • Mobile-Expensify PRs in this staging deploy (13882, 13888, 13919, 13921) involve Onyx bumps, font updates, quick-action JS fixes, and card label changes — none appear related to TestToolsBridge or softKillApp.

    Root Cause

    The root cause is undetermined from available evidence. Two hypotheses:

    1. iOS 26 incompatibility: The softKillApp native implementation in Mobile-Expensify uses an iOS API (e.g., exit(0), UIApplication.shared.perform(#selector(UIApplication.terminate:)), or similar) that behaves differently or is restricted in iOS 26 beta, causing a crash instead of a clean close.

    2. HybridApp native regression: A Mobile-Expensify change not captured in the four listed PRs may have altered the TestToolsBridge iOS implementation in the HybridApp build that was deployed to staging.

    Next steps for the assigned engineer:

    • Check the Mobile-Expensify repo iOS source for the TestToolsBridge module implementation, specifically the softKillApp method.
    • Verify whether the crash reproduces on iOS 17/18 (non-beta) in the staging build. If it only fails on iOS 26, this is an iOS 26 compatibility issue.
    • Check if there were any Mobile-Expensify commits between the production and staging builds that changed the TestToolsBridge iOS code beyond the four listed PRs.
  6. MelvinBot commented on Apr 28, 2026

    @MelvinBot
    Contributor

    Proposal

    What is the root cause of that problem?

    SoftKillTestToolRow/index.native.tsx:14 calls NativeModules.TestToolsBridge.softKillApp() without any null check. The TestToolsBridge native module is not implemented in the App repo — it's provided by Mobile-Expensify. If the native module is not registered at runtime (e.g., removed/broken in the Mobile-Expensify submodule update from d4d623a to 0584bb5, or not available in the current build configuration), TestToolsBridge will be null/undefined, causing a crash when .softKillApp() is called.

    This only affects staging because the soft kill button is only rendered when !isProduction (TroubleshootPage.tsx:236-240).

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

    Add a null guard before calling the native module at SoftKillTestToolRow/index.native.tsx:14:

    onPress={() => NativeModules.TestToolsBridge?.softKillApp()}

    Additionally, investigate what changed in the Mobile-Expensify submodule between d4d623a and 0584bb5 — specifically whether TestToolsBridge native module registration on iOS was removed or broken. The null guard in App is a defensive fix, but if the native module was unintentionally removed, that should also be restored in Mobile-Expensify.

    What alternative solutions did you explore? (Optional)

    • Only fix in Mobile-Expensify: Would fix the root cause if the module was unintentionally broken, but App should still be defensive against missing native modules.
    • Conditionally render the button: Hide SoftKillTestToolRow when TestToolsBridge is unavailable. This is more thorough but the optional chaining fix is simpler and sufficient.
    Investigation details

    Data flow:

    1. User taps with 4 fingers → PanResponder in ScreenWrapperContainer.tsx:170-175 detects numberActiveTouches === 4
    2. toggleTestToolsModal() opens the TestToolsModal
    3. TestToolMenu renders SoftKillTestToolRow
    4. User taps "Kill" → calls NativeModules.TestToolsBridge.softKillApp()
    5. If TestToolsBridge is null → TypeError crash

    Key evidence:

    • TestToolsBridge has zero native implementations in the App repo (searched ios/, android/, modules/)
    • The TypeScript declaration at react-native.d.ts:22-27 declares it as non-optional, but this provides no runtime guarantee
    • The Mobile-Expensify submodule was updated between production and staging
    • The SoftKillTestToolRow component itself hasn't been modified recently — the regression is in the native layer

    Possible contributing factors between production (9.3.63-0) and staging (9.3.64-0):

    1. Mobile-Expensify submodule update (d4d623a → 0584bb5) — primary suspect
    2. NitroModules upgrade 0.29.4 → 0.35.0 (could affect native module initialization)
    3. iOS 26.3 beta compatibility (device used in report)

    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. arosiclair commented on Apr 28, 2026

    @arosiclair
    Contributor

    I reproduced this in prod v9.3.61-4. Demoting

  8. 43 remaining items

  9. melvin-bot commented on May 14, 2026

    @melvin-bot

    📣 @alan747271363-art! 📣
    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:

    1. Make sure you've read and understood the contributing guidelines.
    2. 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.
    3. 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.
    4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
      Screen Shot 2022-11-16 at 4 42 54 PM
      Format:
    Contributor details
    Your Expensify account email: <REPLACE EMAIL HERE>
    Upwork Profile Link: <REPLACE LINK HERE>
    
  10. github-actions commented on May 14, 2026

    @github-actions
    Contributor

    ⚠️ @alan747271363-art Your proposal is a duplicate of an already existing proposal and has been automatically withdrawn to prevent spam. Please review the existing proposals before submitting a new one.

  11. arosiclair commented on May 15, 2026

    @arosiclair
    Contributor
  12. added
    ReviewingHas a PR in review
    InternalRequires API changes or must be handled by Expensify staff
    and removed
    ExternalAdded to denote the issue can be worked on by a contributor
    Help WantedApply this label when an issue is open to proposals by contributors
    on May 15, 2026
  13. situchan commented on May 15, 2026

    @situchan
    Contributor

    Nice! Should we also fix crash in standalone app? Seems a good one for Melvin

    crash.mov
  14. arosiclair commented on May 18, 2026

    @arosiclair
    Contributor

    I think it's fine to leave it for standalone since there's no use for the button there. We added it to test notifications in the HybridApp

  15. melvin-bot commented on May 25, 2026

    @melvin-bot

    @arosiclair Whoops! This issue is 2 days overdue. Let's get this updated quick!

  16. arosiclair commented on May 26, 2026

    @arosiclair
    Contributor

    This is fixed

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

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2InternalRequires API changes or must be handled by Expensify staffReviewingHas a PR in review

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions