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-09-03] [Sentry: APP-JQQ] HybridApp iOS crash opening a universal link — app.keyChain null in TryNewDotManager.navigateToNewDot #98104
Opening a universal link routes through DeepLinkManager.handleUniversalLink, which calls TryNewDotManager.navigateToNewDot. That function reads app.keyChain.getPassword at line 310, and app.keyChain is null at that moment, so the app crashes on the deep link.
continueUserActivity can fire before the app finishes initialising, which would explain a null keychain: the deep link handler runs against a partly constructed app object. Worth confirming whether the crash correlates with a cold start from a link.
The fix is to guard app.keyChain in navigateToNewDot and defer the navigation until initialisation completes, rather than reading through a null.
Reproduction
Unknown. To approximate it: force-quit the app, then open an Expensify universal link so the app cold starts directly into continueUserActivity.
Related
Expensify/Expensify#669639 — "HybridApp deep link always opens OldDot, ignoring tryNewDot NVP". Same code path (DeepLinkManager into TryNewDotManager), so these two may share a root cause.
Root Cause (Medium confidence): On a cold start, iOS delivers the universal link through application:continueUserActivity:before the HybridApp shell finishes initialising. That fires DeepLinkManager.handleUniversalLink → TryNewDotManager.navigateToNewDot, which dereferences app.keyChain.getPassword while app.keyChain is still null → fatal uncaught NSException. The reporter's hypothesis in the description matches the stack trace, and the mechanism (deep-link handler running against a partly-constructed app) is self-consistent.
⚠️ The fix is not in this repo — please route it internally. The crashing code (TryNewDotManager.js, DeepLinkManager.js, YAPL bridge) lives in Mobile-Expensify (the OldDot/HybridApp shell), not Expensify/App. I confirmed Expensify/App's src/libs/ has no navigateToNewDot / getPassword — its equivalent is the unrelated src/libs/TryNewDotUtils.ts. Because the fix requires changes in a repo outside App, an External/Upwork contributor can't implement it. This should be handled by an internal engineer with HybridApp access rather than the current external assignment.
Recommended fix direction (for whoever picks it up internally):
Null-guard app.keyChain in navigateToNewDot before reading getPassword.
If the shell isn't fully initialised yet, queue the pending deep link and replay it once init (keychain) completes, instead of navigating through a null.
Investigation details
Impact: 5 users / 18 events, iOS HybridApp only, v9.4.49-3, first seen 2026-08-02. Low volume, consistent with a cold-start-from-link race rather than a common path.
Not reproducible in this environment: this is an iOS-native continueUserActivity cold start. It can't be reproduced on web (or exercised via the JS-only App codebase), so I did not run a UI test — verification needs an iOS device that cold-starts directly into a universal link (force-quit the app, then open an Expensify universal link).
Could not independently verify line numbers: I don't have read access to Mobile-Expensify, so the :310 / :53 references and the code shape are taken from the crash report, not confirmed against source. That's the main reason this is Medium and not High confidence.
Related: a related internal issue on the same DeepLinkManager → TryNewDotManager path is already linked in the description; they may share a root cause. Parent tracker is [Tracking] Top Sentry crashes monthly check-in #91302.
Next Steps for Contributor+ team:
Because the fix lives in Mobile-Expensify (private), this isn't actionable as an external/Upwork task — please re-route to an internal HybridApp engineer. Reply with @MelvinBot <feedback> to refine this analysis.
I think @MelvinBot's proposed fix would prevent the crash, but I don't think it's sufficient as described:
The null-guard needs to do more than avoid the crash. Simply guarding app.keyChain.getPassword() isn't enough on its own, navigateToNewDot also builds hybridAppSettings.hybridApp.useNewDotSignInPage: !app.isSignedIn(), which is sent to NewDot to tell it whether OldDot already has valid credentials to share. If we guard the keychain access but still report useNewDotSignInPage: false (since isSignedIn() alone is still true), NewDot will assume it can rely on OldDot's session and silently proceed without ever receiving working credentials, trading a crash for a broken, unrecoverable session instead of an actual fix.
"Queue the pending deep link and replay once init completes" doesn't match how initialization actually works here. Expensify.getInstance()'s constructor runs entirely synchronously, by the time it returns, keyChain is already either created or permanently null for that session. There's no async initialization step afterward for a queued deep link to usefully wait on; nothing in the normal app flow ever retries keychain creation short of a full fresh sign-in. This isn't a timing/race issue that resolves with a delay, it's a data-consistency gap between authToken and deviceLoginID/keychain that persists indefinitely once triggered.
You're right on both counts — thanks for the correction. I'll retract the "defer and replay" idea and reframe.
On (1) — the guard is insufficient, and the App side confirms why. The NewDot handshake keys entirely off useNewDotSignInPage, so reporting false while OldDot has no shareable credentials produces exactly the silent broken session you describe:
src/libs/actions/Session/index.ts:783 — sets readyToShowAuthScreens: !useNewDotSignInPage, i.e. it walks straight into the authenticated experience assuming OldDot's session is usable.
src/libs/HybridApp.ts:89 — signInToOldDotAndChooseExperience() also early-returns when !useNewDotSignInPage, so NewDot won't initiate its own sign-in either.
So the real fix isn't "guard the keychain read" — it's making useNewDotSignInPage reflect actual credential shareability, not just isSignedIn(). When the keychain / deviceLoginID is missing, OldDot should send useNewDotSignInPage: true so NewDot falls back to its own sign-in flow instead of silently trusting a session it will never receive.
On (2) — agreed, it's a data-consistency gap, not a race. If getInstance() is fully synchronous and keychain is either created or permanently null by the time it returns, then there's nothing to wait on and queuing is pointless — I withdraw that. That reframes the underlying question to: how does the app end up with a valid authToken but a null deviceLoginID/keychain, and should that divergence be repaired rather than just handled at read time? Making useNewDotSignInPage credential-aware stops the crash and the broken session, but it treats the symptom; whatever lets the two diverge and persist is worth a separate look (e.g. whether a failed keychain creation should also invalidate the session so they can't drift apart).
Both the navigateToNewDot change and that deeper consistency question live in Mobile-Expensify (private), which I can't read or verify — so I'm deferring to your read of the getInstance() / keychain lifecycle there, and the internal engineer picking this up should own that side. The NewDot-side contract above is the part I can confirm from the public App repo.
Also yaplSetSendAuthTokenCallback sets accountInfo.authToken and nothing else, and NewDot fires it on every SESSION write, whereas signInToOldDot (that would create the keychain) early returns if autoGeneratedLogin (or pass) is null, here
changed the title [-][Sentry: APP-JQQ] HybridApp iOS crash opening a universal link — app.keyChain null in TryNewDotManager.navigateToNewDot[/-][+][Due for payment 2026-09-03] [Sentry: APP-JQQ] HybridApp iOS crash opening a universal link — app.keyChain null in TryNewDotManager.navigateToNewDot[/+]on Sep 3, 2026
The fix PR lives in a different repo, so there was nothing for the automation to link. melvin-bot builds the Resolving PRs section from PRs in Expensify/App that link the issue. This bug was fixed in Expensify/Mobile-Expensify#14064 (deployed in 9.4.63-1), and nothing connects that PR to this issue in the issue timeline — no cross-reference or "connected" event. The only place it appears is inside linhvovan29546's comment body, which the automation doesn't read.
Compare with Expensify/App#99719, where the fix was an App PR: its payment summary does include a Resolving PRs: line. This issue's summary just omitted the section because the list came back empty.
Note the issue also had to be reopened manually on 2026-08-28 — same root cause, since GitHub doesn't auto-close across repos.
Evidence
This issue's timeline has exactly one cross-referenced event: Expensify/App#91302 (the Sentry tracking issue). No PR is linked.
Expensify/App#99719 timeline shows Expensify/App#99783 cross-referenced, and that PR is the one listed in its payment summary.
I can't read the exact melvin-bot logic — that repo isn't public — so the mechanism above is inferred from behavior across issues rather than from source. The observable fact is solid though: no linked PR existed for this issue.
If you want the link in the record, the simplest fix is to add it by hand to the payment summary, or have the Mobile-Expensify PR reference Expensify/App#98104 in its description so a cross-reference gets created.
Activity
melvin-bot commentedon Aug 9, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @linhvovan29546 (
External)melvin-bot commentedon Aug 9, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022086528455757581691
MelvinBot commentedon Aug 9, 2026
Issue Analysis
Root Cause (Medium confidence): On a cold start, iOS delivers the universal link through
application:continueUserActivity:before the HybridApp shell finishes initialising. That firesDeepLinkManager.handleUniversalLink→TryNewDotManager.navigateToNewDot, which dereferencesapp.keyChain.getPasswordwhileapp.keyChainis stillnull→ fatal uncaughtNSException. The reporter's hypothesis in the description matches the stack trace, and the mechanism (deep-link handler running against a partly-constructedapp) is self-consistent.TryNewDotManager.js,DeepLinkManager.js, YAPL bridge) lives in Mobile-Expensify (the OldDot/HybridApp shell), notExpensify/App. I confirmedExpensify/App'ssrc/libs/has nonavigateToNewDot/getPassword— its equivalent is the unrelatedsrc/libs/TryNewDotUtils.ts. Because the fix requires changes in a repo outside App, anExternal/Upwork contributor can't implement it. This should be handled by an internal engineer with HybridApp access rather than the current external assignment.Recommended fix direction (for whoever picks it up internally):
app.keyChaininnavigateToNewDotbefore readinggetPassword.null.Investigation details
continueUserActivitycold start. It can't be reproduced on web (or exercised via the JS-only App codebase), so I did not run a UI test — verification needs an iOS device that cold-starts directly into a universal link (force-quit the app, then open an Expensify universal link).:310/:53references and the code shape are taken from the crash report, not confirmed against source. That's the main reason this is Medium and not High confidence.DeepLinkManager→TryNewDotManagerpath is already linked in the description; they may share a root cause. Parent tracker is [Tracking] Top Sentry crashes monthly check-in #91302.Next Steps for Contributor+ team:
Because the fix lives in Mobile-Expensify (private), this isn't actionable as an external/Upwork task — please re-route to an internal HybridApp engineer. Reply with
@MelvinBot <feedback>to refine this analysis.linhvovan29546 commentedon Aug 10, 2026
I think @MelvinBot's proposed fix would prevent the crash, but I don't think it's sufficient as described:
The null-guard needs to do more than avoid the crash. Simply guarding app.keyChain.getPassword() isn't enough on its own, navigateToNewDot also builds hybridAppSettings.hybridApp.useNewDotSignInPage: !app.isSignedIn(), which is sent to NewDot to tell it whether OldDot already has valid credentials to share. If we guard the keychain access but still report useNewDotSignInPage: false (since isSignedIn() alone is still true), NewDot will assume it can rely on OldDot's session and silently proceed without ever receiving working credentials, trading a crash for a broken, unrecoverable session instead of an actual fix.
"Queue the pending deep link and replay once init completes" doesn't match how initialization actually works here. Expensify.getInstance()'s constructor runs entirely synchronously, by the time it returns, keyChain is already either created or permanently null for that session. There's no async initialization step afterward for a queued deep link to usefully wait on; nothing in the normal app flow ever retries keychain creation short of a full fresh sign-in. This isn't a timing/race issue that resolves with a delay, it's a data-consistency gap between authToken and deviceLoginID/keychain that persists indefinitely once triggered.
MelvinBot commentedon Aug 10, 2026
You're right on both counts — thanks for the correction. I'll retract the "defer and replay" idea and reframe.
On (1) — the guard is insufficient, and the App side confirms why. The NewDot handshake keys entirely off
useNewDotSignInPage, so reportingfalsewhile OldDot has no shareable credentials produces exactly the silent broken session you describe:src/libs/actions/Session/index.ts:685-687—clearOnyxIfSigningIn()early-returns when!useNewDotSignInPage, so NewDot never redirects to sign-in.src/libs/actions/Session/index.ts:783— setsreadyToShowAuthScreens: !useNewDotSignInPage, i.e. it walks straight into the authenticated experience assuming OldDot's session is usable.src/libs/HybridApp.ts:89—signInToOldDotAndChooseExperience()also early-returns when!useNewDotSignInPage, so NewDot won't initiate its own sign-in either.So the real fix isn't "guard the keychain read" — it's making
useNewDotSignInPagereflect actual credential shareability, not justisSignedIn(). When the keychain /deviceLoginIDis missing, OldDot should senduseNewDotSignInPage: trueso NewDot falls back to its own sign-in flow instead of silently trusting a session it will never receive.On (2) — agreed, it's a data-consistency gap, not a race. If
getInstance()is fully synchronous and keychain is either created or permanently null by the time it returns, then there's nothing to wait on and queuing is pointless — I withdraw that. That reframes the underlying question to: how does the app end up with a validauthTokenbut a nulldeviceLoginID/keychain, and should that divergence be repaired rather than just handled at read time? MakinguseNewDotSignInPagecredential-aware stops the crash and the broken session, but it treats the symptom; whatever lets the two diverge and persist is worth a separate look (e.g. whether a failed keychain creation should also invalidate the session so they can't drift apart).Both the
navigateToNewDotchange and that deeper consistency question live in Mobile-Expensify (private), which I can't read or verify — so I'm deferring to your read of thegetInstance()/ keychain lifecycle there, and the internal engineer picking this up should own that side. The NewDot-side contract above is the part I can confirm from the public App repo.Julesssss commentedon Aug 10, 2026
@linhvovan29546 agreed good points
Also
yaplSetSendAuthTokenCallbacksetsaccountInfo.authTokenand nothing else, and NewDot fires it on every SESSION write, whereas signInToOldDot (that would create the keychain) early returns ifautoGeneratedLogin(or pass) is null, here31 remaining items
linhvovan29546 commentedon Aug 31, 2026
The PR was deployed in version 9.4.63-1.
linhvovan29546 commentedon Sep 2, 2026
@mountiny @Julesssss Can you please add the Payment label? The payment due date should be September 4, 2026.
[-][Sentry: APP-JQQ] HybridApp iOS crash opening a universal link — app.keyChain null in TryNewDotManager.navigateToNewDot[/-][+][Due for payment 2026-09-03] [Sentry: APP-JQQ] HybridApp iOS crash opening a universal link — app.keyChain null in TryNewDotManager.navigateToNewDot[/+]melvin-bot commentedon Sep 3, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)melvin-bot commentedon Sep 3, 2026
Payment Summary
BugZero Checklist (@mallenexpensify)
linhvovan29546 commentedon Sep 4, 2026
No check list needed
This is a generic flow, so I don’t think we need to regression test it.
mallenexpensify commentedon Sep 4, 2026
@MelvinBot why wasn't the associated PR linked above in the payment summary?
mallenexpensify commentedon Sep 4, 2026
Payment Summary
Contributor+: @linhvovan29546 due $250 via NewDot
MelvinBot commentedon Sep 4, 2026
The fix PR lives in a different repo, so there was nothing for the automation to link.
melvin-botbuilds the Resolving PRs section from PRs inExpensify/Appthat link the issue. This bug was fixed in Expensify/Mobile-Expensify#14064 (deployed in 9.4.63-1), and nothing connects that PR to this issue in the issue timeline — no cross-reference or "connected" event. The only place it appears is insidelinhvovan29546's comment body, which the automation doesn't read.Compare with Expensify/App#99719, where the fix was an App PR: its payment summary does include a
Resolving PRs:line. This issue's summary just omitted the section because the list came back empty.Note the issue also had to be reopened manually on 2026-08-28 — same root cause, since GitHub doesn't auto-close across repos.
Evidence
Expensify/App#91302(the Sentry tracking issue). No PR is linked.Expensify/App#99719timeline showsExpensify/App#99783cross-referenced, and that PR is the one listed in its payment summary.melvin-botlogic — that repo isn't public — so the mechanism above is inferred from behavior across issues rather than from source. The observable fact is solid though: no linked PR existed for this issue.If you want the link in the record, the simplest fix is to add it by hand to the payment summary, or have the Mobile-Expensify PR reference
Expensify/App#98104in its description so a cross-reference gets created.view run · view recording
twisterdotcom commentedon Sep 5, 2026
$250 approved for @linhvovan29546 in Report ID: R00K5qdjoZdN.
Zapier Logs
Run ID: 00040eee-1d74-a72a-89f6-6c79d631e824SO: https://stackoverflowteams.com/c/expensify/questions/7582