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
[Submit] Submit via PDF-The report does not load #97851
Version Number: v9.4.50-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:#97216 Email or phone of affected tester (no customers):applausetester+ag300726@applause.expensifail.com Issue reported by: Applause Internal Team Bug source: Pull Request QA execution Device used: Samsung S23FE/ Android 16 App Component: Money Requests
Action Performed:
Preconditions:
As User A (expensifail account), create a Submit workspace in OD.
Navigate to ND, create an expense in the workspace.
Open the expense, click the dropdown on the Submit button, select "Submit via PDF".
Sign out of User A
Kill the Expensify app (not just backgrounded)
Open the PDF from preconditions
Tap the "Approve or Pay online" button
When redirected to the Sign in screen, enable Use Staging Server
👋 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 (fix lives in Expensify/App) Causing PR: #97216 - "Fix pdf secure link joining on mobile" by @iwiznia (High confidence this PR owns the flow; Medium-High on the exact failure mechanism) Related Issues / PRs: #96697 (issue #97216 was fixing), #94049 "Implement submit via PDF" (introduced the beta-gated feature)
Recommendation: ROLL FORWARD
#97216 is a legitimate, direct owner of this exact flow (not a coincidental QA attribution), but it is an incomplete fix rather than a fresh regression — reverting it would reintroduce the backgrounded-app / new-account cases it fixed. The clean fix is to persist the secure-link signal so it survives an app reload, which is smaller and safer than a revert.
Assigned: @iwiznia (PR author), @cristipaval and @DylanDylann (approving reviewers) — already assigned to this issue by melvin-bot, which is correct here. Labels: No change. DeployBlockerCash is kept (an App PR contributed and the bug is not reproducible in production, so it cannot be removed). DeployBlocker (Web) was not present. Neither blocker label was removed.
📋 Detailed Analysis
Is #97216 actually the cause, or a coincidental QA attribution?
It is genuinely the relevant PR, not a coincidence. #97216 is literally titled "Fix pdf secure link joining on mobile" and modifies exactly the Submit-via-PDF secure-link / report-loading-after-sign-in path described in the repro. It is included in the current StagingDeployCash for v9.4.50. The underlying feature was introduced earlier by #94049 (merged 2026-07-17) and is beta-gated — which is why this is not reproducible in production ("new feature, doesn't exist in prod", per #96697). So the flow is only exercised by internal/beta testers, and #97216 is the PR in this deploy that governs its behavior.
Evidence / Root cause
The distinctive repro step is step 5: "enable Use Staging Server" on the sign-in screen, mid-flow, then sign in with a new Gmail account. Toggling the server reloads the JS bundle. #97216 suppresses onboarding for secure-link visitors (so a new account lands on the shared report instead of onboarding) using a three-part signal:
On native the first two terms are empty/not-yet-set (getCurrentUrl() returns empty on native; the report route is not active yet for a brand-new account still being routed), so the signal collapses to initialURL. But initialURL is volatile React state, not persisted:
It is only ever populated from Linking.getInitialURL() on mount (L39-L46) and from warm-url events (src/DeepLinkHandler.tsx L135-138, added by Fix pdf secure link joining on mobile #97216) —
When "Use Staging Server" reloads the bundle, InitialURLContextProvider remounts and initialURL resets to null; the consumed deep link is not re-delivered by getInitialURL() on that reload. All three terms of getIsVisitingSecureLink() are now false, so onboarding is not suppressed and the brand-new Gmail account is routed into the onboarding flow instead of the shared report → "the report does not load".
Why not production-impacting
"Use Staging Server" is a QA/dev-only toggle; released production builds don't switch servers mid-sign-in, and the feature itself is beta-gated (absent from production). Real-world blast radius is limited to internal/beta testers hitting this specific reload sequence.
Why ROLL FORWARD instead of REVERT
Reverting #97216 restores the pre-fix behavior, where the secure-link signal was only !!currentUrl?.includes('secureKey=') — empty on native — so the new-account native cases it fixed would break again (a worse state). The targeted fix is to persist the secure-link signal across a reload (e.g. store secureKey / a "visiting secure link" flag in Onyx or session storage and read it there), so getIsVisitingSecureLink() survives the toggle-induced reload. Related code paths that rely on the same in-route signal:
Confirmed the affected files (useOnboardingFlow.ts, InitialURLContextProvider.tsx, Link.ts, ReportFetchHandler.tsx, DeepLinkHandler.tsx) are exactly the files Fix pdf secure link joining on mobile #97216 modified, and they own the Submit-via-PDF secure-link → onboarding-suppression → report-load path.
@iwiznia Just to clarify, all tests were done using a fresh PDF.
Issue is reproducible on Samsung S23FE/ Android 16 in v9.4.51-0.
Use Staging Server should be enabled.
Given it is not happening in production, I am going to chalk it up to some config on the deep linking in staging and close this. Please report if it happens in production.
Activity
applause-bot commentedon Aug 5, 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/60c1d4f7356259b1b4443d6e119a1d0ff792f898b068bcd7ecad7253287c851b
melvin-bot commentedon Aug 5, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #97216
melvin-bot commentedon Aug 5, 2026
@cristipaval @DylanDylann you have been assigned to this deploy blocker because you reviewed the offending PR: #97216
melvin-bot commentedon Aug 5, 2026
@iwiznia you have been assigned to this deploy blocker because you authored the offending PR: #97216
melvin-bot commentedon Aug 5, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon Aug 5, 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 5, 2026
🔍 Investigation Summary
Classification: Frontend bug (fix lives in
Expensify/App)Causing PR: #97216 - "Fix pdf secure link joining on mobile" by @iwiznia (High confidence this PR owns the flow; Medium-High on the exact failure mechanism)
Related Issues / PRs: #96697 (issue #97216 was fixing), #94049 "Implement submit via PDF" (introduced the beta-gated feature)
Recommendation: ROLL FORWARD
#97216 is a legitimate, direct owner of this exact flow (not a coincidental QA attribution), but it is an incomplete fix rather than a fresh regression — reverting it would reintroduce the backgrounded-app / new-account cases it fixed. The clean fix is to persist the secure-link signal so it survives an app reload, which is smaller and safer than a revert.
Assigned: @iwiznia (PR author), @cristipaval and @DylanDylann (approving reviewers) — already assigned to this issue by melvin-bot, which is correct here.
Labels: No change.
DeployBlockerCashis kept (an App PR contributed and the bug is not reproducible in production, so it cannot be removed).DeployBlocker(Web) was not present. Neither blocker label was removed.📋 Detailed Analysis
Is #97216 actually the cause, or a coincidental QA attribution?
It is genuinely the relevant PR, not a coincidence. #97216 is literally titled "Fix pdf secure link joining on mobile" and modifies exactly the Submit-via-PDF secure-link / report-loading-after-sign-in path described in the repro. It is included in the current
StagingDeployCashfor v9.4.50. The underlying feature was introduced earlier by #94049 (merged 2026-07-17) and is beta-gated — which is why this is not reproducible in production ("new feature, doesn't exist in prod", per #96697). So the flow is only exercised by internal/beta testers, and #97216 is the PR in this deploy that governs its behavior.Evidence / Root cause
The distinctive repro step is step 5: "enable Use Staging Server" on the sign-in screen, mid-flow, then sign in with a new Gmail account. Toggling the server reloads the JS bundle. #97216 suppresses onboarding for secure-link visitors (so a new account lands on the shared report instead of onboarding) using a three-part signal:
src/hooks/useOnboardingFlow.tsL42-L44:getIsVisitingSecureLink()=hasSecureLinkKey(getCurrentUrl()) || hasSecureLinkKey(Navigation.getActiveRoute()) || hasSecureLinkKey(initialURL)—App/src/hooks/useOnboardingFlow.ts
Lines 42 to 44 in 912a48d
App/src/hooks/useOnboardingFlow.ts
Line 77 in 912a48d
On native the first two terms are empty/not-yet-set (
getCurrentUrl()returns empty on native; the report route is not active yet for a brand-new account still being routed), so the signal collapses toinitialURL. ButinitialURLis volatile React state, not persisted:src/components/InitialURLContextProvider.tsxL36:const [initialURL, setInitialURL] = useState<Route | null>(null);—App/src/components/InitialURLContextProvider.tsx
Line 36 in 912a48d
Linking.getInitialURL()on mount (L39-L46) and from warm-url events (src/DeepLinkHandler.tsxL135-138, added by Fix pdf secure link joining on mobile #97216) —App/src/components/InitialURLContextProvider.tsx
Lines 39 to 46 in 912a48d
When "Use Staging Server" reloads the bundle,
InitialURLContextProviderremounts andinitialURLresets tonull; the consumed deep link is not re-delivered bygetInitialURL()on that reload. All three terms ofgetIsVisitingSecureLink()are now false, so onboarding is not suppressed and the brand-new Gmail account is routed into the onboarding flow instead of the shared report → "the report does not load".Why not production-impacting
"Use Staging Server" is a QA/dev-only toggle; released production builds don't switch servers mid-sign-in, and the feature itself is beta-gated (absent from production). Real-world blast radius is limited to internal/beta testers hitting this specific reload sequence.
Why ROLL FORWARD instead of REVERT
Reverting #97216 restores the pre-fix behavior, where the secure-link signal was only
!!currentUrl?.includes('secureKey=')— empty on native — so the new-account native cases it fixed would break again (a worse state). The targeted fix is to persist the secure-link signal across a reload (e.g. storesecureKey/ a "visiting secure link" flag in Onyx or session storage and read it there), sogetIsVisitingSecureLink()survives the toggle-induced reload. Related code paths that rely on the same in-route signal:src/libs/actions/Link.tsL519-L538 —App/src/libs/actions/Link.ts
Lines 519 to 538 in 912a48d
src/pages/inbox/ReportFetchHandler.tsxL162-L164 and L269-L275 —App/src/pages/inbox/ReportFetchHandler.tsx
Lines 269 to 275 in 912a48d
Verification
StagingDeployCashfor v9.4.50 (body references PR 97216).useOnboardingFlow.ts,InitialURLContextProvider.tsx,Link.ts,ReportFetchHandler.tsx,DeepLinkHandler.tsx) are exactly the files Fix pdf secure link joining on mobile #97216 modified, and they own the Submit-via-PDF secure-link → onboarding-suppression → report-load path.7 remaining items
iwiznia commentedon Aug 5, 2026
Not a blocker due to the reasons melvin said above.
iwiznia commentedon Aug 5, 2026
@jponikarchuk can you reproduce this with a fresh PDF? As @DylanDylann said, the link is one time use.
jponikarchuk commentedon Aug 6, 2026
@iwiznia Just to clarify, all tests were done using a fresh PDF.
Issue is reproducible on Samsung S23FE/ Android 16 in v9.4.51-0.
Use Staging Server should be enabled.
Repro.1-97851.mp4
[-]Submit via PDF-The report does not load[/-][+][Submit] Submit via PDF-The report does not load[/+]iwiznia commentedon Aug 7, 2026
IuliiaHerets commentedon Aug 8, 2026
@iwiznia Yes, the issue is not reproducible for existing accounts.
97851-1.mp4
No, also reproducible with a private domain account without +.
97851-2.mp4
The issue is not reproducible in Prod now, but the behavior differs from that in Staging. The onboarding modal is displayed during the Prod test.
97851-3.mp4
The need to switch to the staging server is because:
iwiznia commentedon Aug 10, 2026
Given it is not happening in production, I am going to chalk it up to some config on the deep linking in staging and close this. Please report if it happens in production.