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-07-30] [$250] QBO - Can't connect on Android app #94142
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor
Version Number: v9.4.16-1 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from BrowserStack:https://test-management.browserstack.com/projects/2219752/folder/13176908/test-cases/73685192 Email or phone of affected tester (no customers): - Issue reported by: Applause Internal Team Bug source: Regression TC Execution Device used: Xiaomi RedMi Note 10 / Android 12 App Component: Other
Action Performed:
Precondition: workspace with enabled Accounting feature.
Root Cause (medium confidence): On Android the QBO Connect button does not open an external browser tab. It mounts an in-app react-native-webview pointed at the Expensify backend command URL …/api/ConnectPolicyToQuickbooksOnline?policyID=…, authenticating via a Cookie: authToken=… header (ConnectToQuickbooksOnlineFlow/index.native.tsx:58-69). That endpoint is supposed to 302-redirect the WebView into the QuickBooks/Intuit login page. The "blank tab with an Autoformatting checkbox" is the WebView rendering a non-QBO page — i.e. the redirect into QuickBooks is not happening, so the WebView shows whatever HTML the request returned instead.
This is Android-only by design: the web variant opens a real new browser tab via Link.openLink(...) (index.tsx:11-16), which is why iOS / mWeb / desktop are unaffected.
Why this likely isn't an App-repo regression: The native flow component and the URL builder (QuickbooksOnline.ts:19-26) have not changed since April–May 2026, yet the bug is new in v9.4.16 and reproduces in production. That pattern points to a change in what the backend ConnectPolicyToQuickbooksOnline command returns to the WebView request (e.g. the cookie-header auth not being honored, or the redirect chain no longer landing on Intuit), rather than to App code.
Recommended next step: This requires a backend/internal investigation of the ConnectPolicyToQuickbooksOnline endpoint — specifically, what it returns for an Android react-native-webview request carrying Cookie: authToken=… (status code, whether it 302s to Intuit or returns a 200 HTML body, and whether the cookie auth is accepted). That lives outside the App repo, so please escalate to an internal engineer with backend access to confirm. There is no App-side fix to make until the redirect/auth failure is understood.
Investigation details & evidence
Flow on tap (Connect → WebView):
startIntegrationFlow({name: QBO}) in PolicyAccountingPage.tsx sets the active integration and renders setupConnectionFlow.
For QBO, setupConnectionFlow is <ConnectToQuickbooksOnlineFlow/> (accounting/utils.tsx:89-98). React Native resolves index.native.tsx on Android, index.tsx on web.
There is no Linking.openURL on the native path — it's an embedded fullscreen WebView.
The URL loaded is an Expensify backend command, not a QBO URL directly: getQuickbooksOnlineSetupLink builds …/api/ConnectPolicyToQuickbooksOnline?policyID=… with shouldSkipWebProxy: true, which forces the production www.expensify.com host on native. The backend is expected to redirect to Intuit OAuth.
"Autoformatting checkbox" is not an Expensify screen. A full search of src (and src/languages/en.ts) finds noautoformat / auto-format string anywhere in the App — the only matches are inside the node_modules/xlsx library internals. So the checkbox is content of the page the WebView actually loaded (an Intuit/error/interstitial page or Android system WebView chrome), not an in-app route. This rules out an in-app deep-link/route mismatch.
Alternative explanations considered:
react-native-webview bump altering Android cookie/redirect/incognito handling — the component already uses the Android-only incognito workaround (line 66), which disables cookie persistence on Android. A backend change to how the authToken cookie is validated would interact badly with this. Worth ruling out alongside the backend check.
In-app route mismatch — ruled out (no Autoformatting screen exists in App).
Next Steps for Contributor+ team: The likely fix is backend, not App. Please escalate the ConnectPolicyToQuickbooksOnline redirect/auth behavior to an internal engineer. To refine:@MelvinBot <your feedback> (e.g. if you can share a device repro of what the WebView actually displays, or a requestID from an affected attempt).
🚨 Edited by proposal-police: This proposal was edited at 2026-07-07 22:28:37 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
On the Android app, Workspace > Accounting > QuickBooks Online > Connect opens a blank page with an "Autoformatting" checkbox instead of the QBO credentials page, so the connection can never be completed on Android. This still reproduces on latest main, where the flow now lives in QuickbooksOnlineSetupPage → the shared AccountingSetupWebViewPage (PR #92512) and the WebView already passes userAgent={getUAForWebView()}.
What is the root cause of that problem?
The "blank page with an Autoformatting checkbox" is not a rendering problem — it is Android System WebView's built-in JSON viewer, whose pretty-print checkbox only appears when the document response is application/json. So the WebView never receives Intuit's login page; it receives a JSON error from the setup endpoint, matching the chrome://inspect capture shared earlier in this thread: 200 application/json with {"jsonCode":407, "title":"Session expired"}. In other words, ConnectPolicyToQuickbooksOnline is reached unauthenticated. The flow's only credential is the raw session token injected as a request header on the WebView source:
That transport is fragile by design on Android: source.headers only accompany the initial loadUrl navigation (the incognito prop on this very WebView exists solely to work around the Cookie header being dropped, react-native-webview/react-native-webview#1352), so any hop inserted in front of the command — a redirect or an interstitial — re-requests the URL without the header. That environment has now changed: www.expensify.com/api/* sits behind Cloudflare bot mitigation (a plain GET to any /api/ command from a non-browser client returns 403 with cf-mitigated: challenge, while the same client fetches the homepage with 200), and this WebView is a prime target for it because getUAForWebView() spoofs a two-year-stale Chrome/124.0.6367.159 UA that contradicts the Chromium version the WebView advertises in its Sec-CH-UA client hints. A managed challenge auto-solves and reloads the URL without the one-shot Cookie header, the API answers 407 "Session expired" as JSON, and the JSON viewer paints the reported "blank" page. Because the trigger is server-side risk scoring rather than App code, this explains why the bug appeared in production and staging with no relevant App change, why reproduction has been intermittent per device and network (not reproducible on 2026-06-24, reproducible again now), and why web is unaffected — it never uses a WebView, and openLink → openOldDotLink authenticates the very same command URL with a short-lived token in the URL, which survives any reload. On iOS getUAForWebView() returns undefined, so its WKWebView presents a genuine UA instead of a spoofed one.
The decisive falsification of the user-agent theory (which the original version of this proposal also advanced) is issue #95199: Xero — which has carried userAgent={getUAForWebView()} since 2024 and now shares this exact AccountingSetupWebViewPage — started failing the same way on Android in production and staging on 2026-07-02. The UA override was also added to the QBO WebView by PR #92512 and the bug still reproduces on main. Both issues share one mechanism: the Cookie-header auth transport, not the user agent.
What changes do you think we should make in order to solve the problem?
Authenticate the WebView the way web and the already-shipped HR connect flow authenticate the same class of OldDot links: fetch a short-lived auth token and carry it in the URL, so every hop (challenge reloads and redirects included) stays authenticated. The helper already exists in src/libs/actions/Link.ts — it calls OpenOldDotLink, appends authToken=<shortLivedAuthToken> to the link, and falls back to the raw link if the request fails:
While authenticatedUrl is null we show the existing renderLoading indicator, then render the WebView with source={{uri: authenticatedUrl}}; incognito, startInLoadingState, the offline wrapper and back handling all stay as they are, and the existing Cookie header can be kept as belt-and-braces or dropped in the PR since correctness no longer depends on it. This is precisely the pattern ConnectToHRFlow ships with today on Android and iOS against the same OldDot backend (PR #92075):
Because the change lands in the shared component, it fixes this issue and #95199 (Xero) together, adds one round-trip that web already pays for the same links, and touches no web code — ConnectToQuickbooksOnlineFlow/index.tsx keeps opening the link through openLink exactly as before.
What alternative solutions did you explore? (Optional)
Writing the session cookie into the Android cookie store natively (CookieManager from @react-native-cookies/cookies) before loading — rejected because it adds a native dependency and cookie state is exactly what the incognito profile and challenge interstitials clear, so it re-creates the same fragility. Opening the setup link in the external browser via openOldDotLink, mirroring web — rejected because it abandons the established in-app WebView UX for accounting connections and would diverge QBO/Xero from every sibling native flow.
Please re-state the problem that we are trying to solve in this issue.
On the Android native app, Workspace > Accounting > QuickBooks Online > Connect opens a blank tab (the tester sees only an "Autoformatting" checkbox overlay) instead of the QBO credentials/OAuth page, so the QBO connection can never be completed on Android. iOS native and web/mWeb work.
What is the root cause of that problem?
The QBO connect flow on native loads getQuickbooksOnlineSetupLink(policyID) inside a single in-app WebView:
incognito// 'incognito' prop required for Android, issue here https://github.com/react-native-webview/react-native-webview/issues/1352
startInLoadingState
renderLoading={renderLoading}
/>
That OldDot endpoint redirects into Intuit's OAuth flow, and the Intuit/OldDot handoff opens its next step in a new window (a target="_blank" link / window.open). On Android, react-native-webview defaults setSupportMultipleWindows to true, which routes any new-window request to the native onCreateWindow path. Our QBO WebView provides noonOpenWindow handler and does not set setSupportMultipleWindows, so Android honors the new-window request but has nowhere to put it — it surfaces an empty secondary view with no loaded content. That is exactly the "blank tab" the reporter sees; the "Autoformatting checkbox" is just Android's autofill overlay on an empty page.
This is Android-only because setSupportMultipleWindows is an Android-WebView concept: on iOS WebKit the same target="_blank" navigation is loaded in the main frame by default, so the OAuth page appears and iOS works. Android is the one platform that splits the flow off into an unhandled blank window.
Note this is a distinct mechanism from the user-agent theory: even with a Chrome UA, an unhandled new-window navigation on Android still lands in a blank window. The missing piece here is multiple-window handling, not the UA string.
What changes do you think we should make in order to solve the problem?
Tell the QBO WebView to keep the OAuth navigation in the same frame instead of spawning an unhandled new window, by setting setSupportMultipleWindows={false} on the WebView:
With setSupportMultipleWindows={false}, Android loads target="_blank"/window.open navigations in the current WebView rather than handing them to an unmanaged new window, so the QBO/Intuit credentials page renders inline and the user can complete the connection. The prop is a no-op on iOS (it only affects the Android WebChromeClient), so the working iOS behavior is preserved exactly, and no web/mWeb code changes. The existing Cookie: authToken header, incognito, loader, and offline wrapper are untouched.
What alternative solutions did you explore? (Optional)
Add the new window as a managed popup: keep setSupportMultipleWindows enabled and implement an onOpenWindow handler that renders the target URL in an overlay WebView (the pattern used by the HR connection flow), with Android back closing the popup first. This works but adds popup state, an extra WebView, and back-handling for what is a linear OAuth step, so forcing same-window navigation is the smaller fix.
Override the WebView user agent with getUAForWebView() (as the Xero flow does). That addresses a different failure mode (embedded-WebView UA rejection) and does not handle the unmanaged new-window navigation that produces the blank tab here.
Drop the in-app WebView entirely and open the setup link externally via Link.openLink (matching the web index.tsx). That changes the established in-app, cookie-authenticated flow and is a larger behavioral change than keeping the navigation inside the existing WebView.
Please re-state the problem that we are trying to solve in this issue.
On Android native, tapping Workspace > Accounting > QuickBooks Online > Connect should open the QBO credentials/OAuth flow, but it opens a blank tab/page instead.
What is the root cause of that problem?
The Android app is using src/components/ConnectToQuickbooksOnlineFlow/index.native.tsx, not the shared index.tsx flow. In ConnectToQuickbooksOnlineFlow, lines 58-69 render getQuickbooksOnlineSetupLink(policyID) directly inside a react-native-webview with only a manually injected authToken cookie.
That bypasses the working Link.openLink(getQuickbooksOnlineSetupLink(policyID), environmentURL) path used by src/components/ConnectToQuickbooksOnlineFlow/index.tsx. openLink() routes old-dot Expensify URLs through openOldDotLink() in src/libs/actions/Link.ts, which requests a short-lived auth token and opens the authenticated old-dot/OAuth URL externally. The QBO connect flow is an external OAuth flow, so loading it in the Android WebView causes the blank tab instead of reaching the QBO credentials page.
What changes do you think we should make in order to solve the problem?
Add an Android-specific implementation for QBO connect, e.g. src/components/ConnectToQuickbooksOnlineFlow/index.android.tsx, that mirrors the shared browser-opening flow:
call PolicyAction.enablePolicyTaxes(policyID, false) as today;
call Link.openLink(getQuickbooksOnlineSetupLink(policyID), environmentURL) instead of rendering the setup URL in a WebView;
return null, matching index.tsx.
This keeps the change scoped to Android, preserves the existing tax-disabling side effect, and reuses the existing authenticated old-dot external-link handling in src/libs/actions/Link.ts instead of adding QBO-specific OAuth/WebView logic.
Manual verification: on Android native, go to Workspace > Accounting > QuickBooks Online > Connect and confirm the QBO credentials page opens instead of a blank tab. Also verify web still opens the same QBO setup link and existing connected-workspace accounting settings are unchanged.
What alternative solutions did you explore? (Optional)
We could try to make the QBO WebView support this OAuth flow by adding a custom user agent, popup handling, cookie sharing, and redirect handling similar to other native WebView flows. That is riskier for this bug because the expected behavior is an external tab and the app already has a working authenticated external-link path for old-dot commands.
The Android QBO native connection flow loads the OldDot QBO setup endpoint inside a single react-native-webview and does not handle popup/new-window navigation from the OAuth flow. On Android, when the QBO setup page opens the provider auth step in a new window, our WebView has no onOpenWindow handler, so Android creates the wrong blank WebView/tab instead of showing the QBO credentials page.
Evidence:
QBO native uses one WebView, with no onOpenWindow or popup WebView handling:
The current HR flow has the missing pattern: it stores event.nativeEvent.targetUrl in handleOpenWindow, renders an overlay popup WebView, and makes Android back close the popup first:
Scope the behavior to native QBO only; no web/mWeb changes.
If reviewers prefer stricter Android scope, guard onOpenWindow and popup rendering with Android platform checks so iOS native keeps the exact current behavior.
Preserve the existing Cookie: authToken, incognito, FullPageOfflineBlockingView, and loader.
Test Android native QBO connect, Android back behavior from the popup, offline state, and smoke-test iOS native QBO to confirm unchanged behavior.
What alternative solutions did you explore? (Optional)
Opening the QBO URL externally with Linking.openURL could bypass WebView popup handling, but it changes the existing authenticated in-app flow and risks losing the current cookie/header behavior. Reusing the already-merged HR OAuth popup pattern fixes the Android-specific root cause with a smaller blast radius.
godzillaxbox19982014-lgtm commented on Jun 22, 2026
The local evidence matches this recurring failure shape: NewDot and OldDot read different default account/card fields. Here, src/pages/workspace/accounting/qbo/advanced/QuickbooksAdvancedPage.tsx:37 and src/pages/workspace/accounting/qbo/advanced/QuickbooksInvoiceAccountSelectPage.tsx:31 do not agree on the same QBO, QuickBooks value, so the user-visible path can show a missing or stale state even though nearby data already has the needed context.
What changes do you think we should make in order to solve the problem?
Update src/pages/workspace/accounting/qbo/advanced/QuickbooksAdvancedPage.tsx:37 to derive QBO, QuickBooks from the card/accounting data source that owns this flow before the value is consumed.
Carry the same normalized value through src/pages/workspace/accounting/qbo/advanced/QuickbooksInvoiceAccountSelectPage.tsx:31; that follows the safer family move to add fallback at the export/mapping layer, so the write/optimistic/read paths agree instead of only changing the visible component.
Keep the change inside the Payments, Wallet, Bank, Billing, Cards surface and avoid changing money movement, bank/card/account settings.
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
Add or update a regression in tests/unit/Payment*.ts for the exact issue flow: [$250] QBO - Can't connect on Android app.
Cover the counter-case near src/pages/workspace/accounting/qbo/advanced/QuickbooksAdvancedPage.tsx:37 so valid existing QBO, QuickBooks behavior still works.
Manually repeat the issue steps after the patch and confirm the visible state/action is no longer stale.
What alternative solutions did you explore? (Optional)
I would not add a broad new condition outside these referenced paths; the safer fix is to keep QBO, QuickBooks consistent at the first read/write boundary shown above.
[Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to comment:
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion:
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Root cause was a long‑standing latent fragility: the native setup WebView authenticated only via a first‑request Cookie: authToken header, which is dropped on any redirect/interstitial hop. Once an extra hop was inserted in front of the www.expensify.com/api/* command (server‑side risk/bot mitigation), the URL was re‑requested unauthenticated and the raw JSON command response rendered — the reported "blank tab with Autoformatting/Pretty‑print checkbox" is Android WebView's JSON viewer.
The decisive evidence that no App PR caused it: Xero regressed the same way at the same time ([Due for payment 2026-07-23] [$250] Android - Accounting - Unable to connect to Xero #95199), despite sharing this flow and having carried its own overrides for years with no relevant App change. Two independent flows breaking simultaneously points at the environment, not a code diff.
The fix (#96768, and the Xero twin #95552) wasn't a revert — it added resilience by appending a short‑lived authToken to the URL (shouldAppendShortLivedAuthToken) so auth survives redirects.
For the BZ checklist: I'd mark the "offending PR" item N/A — there's no App PR to comment on. If you want a code‑side attribution for the record, the closest thing is the original design choice to authenticate these native accounting‑connect WebViews with a one‑shot Cookie header (predates the bug by many months), but that's not a regression‑introducing PR.
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor
Activity
applause-bot commentedon Jun 22, 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/f7967ac4653f0bb848b5ca4d3d05b45cd4bdfa36fcbde450ea6337441ebcf4bc
MelvinBot commentedon Jun 22, 2026
Issue Analysis
Root Cause (medium confidence): On Android the QBO Connect button does not open an external browser tab. It mounts an in-app
react-native-webviewpointed at the Expensify backend command URL…/api/ConnectPolicyToQuickbooksOnline?policyID=…, authenticating via aCookie: authToken=…header (ConnectToQuickbooksOnlineFlow/index.native.tsx:58-69). That endpoint is supposed to302-redirect the WebView into the QuickBooks/Intuit login page. The "blank tab with an Autoformatting checkbox" is the WebView rendering a non-QBO page — i.e. the redirect into QuickBooks is not happening, so the WebView shows whatever HTML the request returned instead.This is Android-only by design: the web variant opens a real new browser tab via
Link.openLink(...)(index.tsx:11-16), which is why iOS / mWeb / desktop are unaffected.Why this likely isn't an App-repo regression: The native flow component and the URL builder (
QuickbooksOnline.ts:19-26) have not changed since April–May 2026, yet the bug is new in v9.4.16 and reproduces in production. That pattern points to a change in what the backendConnectPolicyToQuickbooksOnlinecommand returns to the WebView request (e.g. the cookie-header auth not being honored, or the redirect chain no longer landing on Intuit), rather than to App code.Recommended next step: This requires a backend/internal investigation of the
ConnectPolicyToQuickbooksOnlineendpoint — specifically, what it returns for an Androidreact-native-webviewrequest carryingCookie: authToken=…(status code, whether it302s to Intuit or returns a200HTML body, and whether the cookie auth is accepted). That lives outside the App repo, so please escalate to an internal engineer with backend access to confirm. There is no App-side fix to make until the redirect/auth failure is understood.Investigation details & evidence
Flow on tap (Connect → WebView):
startIntegrationFlow({name: QBO})inPolicyAccountingPage.tsxsets the active integration and renderssetupConnectionFlow.setupConnectionFlowis<ConnectToQuickbooksOnlineFlow/>(accounting/utils.tsx:89-98). React Native resolvesindex.native.tsxon Android,index.tsxon web.Linking.openURLon the native path — it's an embedded fullscreen WebView.The URL loaded is an Expensify backend command, not a QBO URL directly:
getQuickbooksOnlineSetupLinkbuilds…/api/ConnectPolicyToQuickbooksOnline?policyID=…withshouldSkipWebProxy: true, which forces the productionwww.expensify.comhost on native. The backend is expected to redirect to Intuit OAuth."Autoformatting checkbox" is not an Expensify screen. A full search of
src(andsrc/languages/en.ts) finds noautoformat/auto-formatstring anywhere in the App — the only matches are inside thenode_modules/xlsxlibrary internals. So the checkbox is content of the page the WebView actually loaded (an Intuit/error/interstitial page or Android system WebView chrome), not an in-app route. This rules out an in-app deep-link/route mismatch.Alternative explanations considered:
incognitohandling — the component already uses the Android-onlyincognitoworkaround (line 66), which disables cookie persistence on Android. A backend change to how theauthTokencookie is validated would interact badly with this. Worth ruling out alongside the backend check.Next Steps for Contributor+ team: The likely fix is backend, not App. Please escalate the
ConnectPolicyToQuickbooksOnlineredirect/auth behavior to an internal engineer.To refine:
@MelvinBot <your feedback>(e.g. if you can share a device repro of what the WebView actually displays, or a requestID from an affected attempt).MobileMage commentedon Jun 22, 2026
🚨 Edited by proposal-police: This proposal was edited at 2026-07-07 22:28:37 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
On the Android app, Workspace > Accounting > QuickBooks Online > Connect opens a blank page with an "Autoformatting" checkbox instead of the QBO credentials page, so the connection can never be completed on Android. This still reproduces on latest main, where the flow now lives in
QuickbooksOnlineSetupPage→ the sharedAccountingSetupWebViewPage(PR #92512) and the WebView already passesuserAgent={getUAForWebView()}.What is the root cause of that problem?
The "blank page with an Autoformatting checkbox" is not a rendering problem — it is Android System WebView's built-in JSON viewer, whose pretty-print checkbox only appears when the document response is
application/json. So the WebView never receives Intuit's login page; it receives a JSON error from the setup endpoint, matching thechrome://inspectcapture shared earlier in this thread:200 application/jsonwith{"jsonCode":407, "title":"Session expired"}. In other words,ConnectPolicyToQuickbooksOnlineis reached unauthenticated. The flow's only credential is the raw session token injected as a request header on the WebView source:App/src/pages/workspace/accounting/AccountingSetupWebViewPage.tsx
Lines 60 to 64 in 6a0f1e5
That transport is fragile by design on Android:
source.headersonly accompany the initialloadUrlnavigation (theincognitoprop on this very WebView exists solely to work around the Cookie header being dropped, react-native-webview/react-native-webview#1352), so any hop inserted in front of the command — a redirect or an interstitial — re-requests the URL without the header. That environment has now changed:www.expensify.com/api/*sits behind Cloudflare bot mitigation (a plain GET to any/api/command from a non-browser client returns403withcf-mitigated: challenge, while the same client fetches the homepage with200), and this WebView is a prime target for it becausegetUAForWebView()spoofs a two-year-staleChrome/124.0.6367.159UA that contradicts the Chromium version the WebView advertises in itsSec-CH-UAclient hints. A managed challenge auto-solves and reloads the URL without the one-shot Cookie header, the API answers 407 "Session expired" as JSON, and the JSON viewer paints the reported "blank" page. Because the trigger is server-side risk scoring rather than App code, this explains why the bug appeared in production and staging with no relevant App change, why reproduction has been intermittent per device and network (not reproducible on 2026-06-24, reproducible again now), and why web is unaffected — it never uses a WebView, andopenLink→openOldDotLinkauthenticates the very same command URL with a short-lived token in the URL, which survives any reload. On iOSgetUAForWebView()returnsundefined, so its WKWebView presents a genuine UA instead of a spoofed one.The decisive falsification of the user-agent theory (which the original version of this proposal also advanced) is issue #95199: Xero — which has carried
userAgent={getUAForWebView()}since 2024 and now shares this exactAccountingSetupWebViewPage— started failing the same way on Android in production and staging on 2026-07-02. The UA override was also added to the QBO WebView by PR #92512 and the bug still reproduces on main. Both issues share one mechanism: the Cookie-header auth transport, not the user agent.What changes do you think we should make in order to solve the problem?
Authenticate the WebView the way web and the already-shipped HR connect flow authenticate the same class of OldDot links: fetch a short-lived auth token and carry it in the URL, so every hop (challenge reloads and redirects included) stays authenticated. The helper already exists in
src/libs/actions/Link.ts— it callsOpenOldDotLink, appendsauthToken=<shortLivedAuthToken>to the link, and falls back to the raw link if the request fails:App/src/libs/actions/Link.ts
Lines 429 to 433 in 6a0f1e5
In the shared
AccountingSetupWebViewPage, resolve the authenticated URL before mounting the WebView and load that instead of the bareuri:While
authenticatedUrlis null we show the existingrenderLoadingindicator, then render the WebView withsource={{uri: authenticatedUrl}};incognito,startInLoadingState, the offline wrapper and back handling all stay as they are, and the existing Cookie header can be kept as belt-and-braces or dropped in the PR since correctness no longer depends on it. This is precisely the patternConnectToHRFlowships with today on Android and iOS against the same OldDot backend (PR #92075):App/src/components/ConnectToHRFlow/index.native.tsx
Lines 36 to 40 in 6a0f1e5
Because the change lands in the shared component, it fixes this issue and #95199 (Xero) together, adds one round-trip that web already pays for the same links, and touches no web code —
ConnectToQuickbooksOnlineFlow/index.tsxkeeps opening the link throughopenLinkexactly as before.What alternative solutions did you explore? (Optional)
Writing the session cookie into the Android cookie store natively (
CookieManagerfrom@react-native-cookies/cookies) before loading — rejected because it adds a native dependency and cookie state is exactly what the incognito profile and challenge interstitials clear, so it re-creates the same fragility. Opening the setup link in the external browser viaopenOldDotLink, mirroring web — rejected because it abandons the established in-app WebView UX for accounting connections and would diverge QBO/Xero from every sibling native flow.lorretheboy commentedon Jun 22, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
On the Android native app, Workspace > Accounting > QuickBooks Online > Connect opens a blank tab (the tester sees only an "Autoformatting" checkbox overlay) instead of the QBO credentials/OAuth page, so the QBO connection can never be completed on Android. iOS native and web/mWeb work.
What is the root cause of that problem?
The QBO connect flow on native loads
getQuickbooksOnlineSetupLink(policyID)inside a single in-appWebView:App/src/components/ConnectToQuickbooksOnlineFlow/index.native.tsx
Lines 58 to 69 in 2b78b56
That OldDot endpoint redirects into Intuit's OAuth flow, and the Intuit/OldDot handoff opens its next step in a new window (a
target="_blank"link /window.open). On Android,react-native-webviewdefaultssetSupportMultipleWindowstotrue, which routes any new-window request to the nativeonCreateWindowpath. Our QBOWebViewprovides noonOpenWindowhandler and does not setsetSupportMultipleWindows, so Android honors the new-window request but has nowhere to put it — it surfaces an empty secondary view with no loaded content. That is exactly the "blank tab" the reporter sees; the "Autoformatting checkbox" is just Android's autofill overlay on an empty page.This is Android-only because
setSupportMultipleWindowsis an Android-WebView concept: on iOS WebKit the sametarget="_blank"navigation is loaded in the main frame by default, so the OAuth page appears and iOS works. Android is the one platform that splits the flow off into an unhandled blank window.Note this is a distinct mechanism from the user-agent theory: even with a Chrome UA, an unhandled new-window navigation on Android still lands in a blank window. The missing piece here is multiple-window handling, not the UA string.
What changes do you think we should make in order to solve the problem?
Tell the QBO
WebViewto keep the OAuth navigation in the same frame instead of spawning an unhandled new window, by settingsetSupportMultipleWindows={false}on theWebView:App/src/components/ConnectToQuickbooksOnlineFlow/index.native.tsx
Lines 58 to 69 in 2b78b56
With
setSupportMultipleWindows={false}, Android loadstarget="_blank"/window.opennavigations in the currentWebViewrather than handing them to an unmanaged new window, so the QBO/Intuit credentials page renders inline and the user can complete the connection. The prop is a no-op on iOS (it only affects the Android WebChromeClient), so the working iOS behavior is preserved exactly, and no web/mWeb code changes. The existingCookie: authTokenheader,incognito, loader, and offline wrapper are untouched.What alternative solutions did you explore? (Optional)
setSupportMultipleWindowsenabled and implement anonOpenWindowhandler that renders the target URL in an overlayWebView(the pattern used by the HR connection flow), with Android back closing the popup first. This works but adds popup state, an extraWebView, and back-handling for what is a linear OAuth step, so forcing same-window navigation is the smaller fix.getUAForWebView()(as the Xero flow does). That addresses a different failure mode (embedded-WebView UA rejection) and does not handle the unmanaged new-window navigation that produces the blank tab here.Link.openLink(matching the webindex.tsx). That changes the established in-app, cookie-authenticated flow and is a larger behavioral change than keeping the navigation inside the existing WebView.melvin-bot commentedon Jun 22, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @aimane-chnaif (
External)kitvasyl commentedon Jun 22, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
On Android native, tapping Workspace > Accounting > QuickBooks Online > Connect should open the QBO credentials/OAuth flow, but it opens a blank tab/page instead.
What is the root cause of that problem?
The Android app is using
src/components/ConnectToQuickbooksOnlineFlow/index.native.tsx, not the sharedindex.tsxflow. InConnectToQuickbooksOnlineFlow, lines 58-69 rendergetQuickbooksOnlineSetupLink(policyID)directly inside areact-native-webviewwith only a manually injectedauthTokencookie.That bypasses the working
Link.openLink(getQuickbooksOnlineSetupLink(policyID), environmentURL)path used bysrc/components/ConnectToQuickbooksOnlineFlow/index.tsx.openLink()routes old-dot Expensify URLs throughopenOldDotLink()insrc/libs/actions/Link.ts, which requests a short-lived auth token and opens the authenticated old-dot/OAuth URL externally. The QBO connect flow is an external OAuth flow, so loading it in the Android WebView causes the blank tab instead of reaching the QBO credentials page.What changes do you think we should make in order to solve the problem?
Add an Android-specific implementation for QBO connect, e.g.
src/components/ConnectToQuickbooksOnlineFlow/index.android.tsx, that mirrors the shared browser-opening flow:PolicyAction.enablePolicyTaxes(policyID, false)as today;Link.openLink(getQuickbooksOnlineSetupLink(policyID), environmentURL)instead of rendering the setup URL in a WebView;null, matchingindex.tsx.This keeps the change scoped to Android, preserves the existing tax-disabling side effect, and reuses the existing authenticated old-dot external-link handling in
src/libs/actions/Link.tsinstead of adding QBO-specific OAuth/WebView logic.Manual verification: on Android native, go to Workspace > Accounting > QuickBooks Online > Connect and confirm the QBO credentials page opens instead of a blank tab. Also verify web still opens the same QBO setup link and existing connected-workspace accounting settings are unchanged.
What alternative solutions did you explore? (Optional)
We could try to make the QBO WebView support this OAuth flow by adding a custom user agent, popup handling, cookie sharing, and redirect handling similar to other native WebView flows. That is riskier for this bug because the expected behavior is an external tab and the app already has a working authenticated external-link path for old-dot commands.
[-]QBO - Can't connect on Android app[/-][+][$250] QBO - Can't connect on Android app[/+]melvin-bot commentedon Jun 22, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022068957073168668976
mukhrr commentedon Jun 22, 2026
Proposal
What is the root cause of that problem?
The Android QBO native connection flow loads the OldDot QBO setup endpoint inside a single
react-native-webviewand does not handle popup/new-window navigation from the OAuth flow. On Android, when the QBO setup page opens the provider auth step in a new window, our WebView has noonOpenWindowhandler, so Android creates the wrong blank WebView/tab instead of showing the QBO credentials page.Evidence:
WebView, with noonOpenWindowor popup WebView handling:App/src/components/ConnectToQuickbooksOnlineFlow/index.native.tsx
Lines 58 to 69 in cc90dd2
ConnectPolicyToQuickbooksOnlinecommand URL, so the OAuth handoff happens from inside this WebView:App/src/libs/actions/connections/QuickbooksOnline.ts
Lines 19 to 25 in cc90dd2
onOpenWindow: [HR Import] ConnectToHRFlow popup handling and authentication on native #92075event.nativeEvent.targetUrlinhandleOpenWindow, renders an overlay popup WebView, and makes Android back close the popup first:App/src/components/ConnectToHRFlow/index.native.tsx
Lines 66 to 91 in cc90dd2
App/src/components/ConnectToHRFlow/index.native.tsx
Lines 123 to 144 in cc90dd2
What changes do you think we should make in order to solve the problem?
Add Android-only popup handling to
ConnectToQuickbooksOnlineFlow/index.native.tsx, matching the proven HR OAuth pattern, while keeping the existing QBO setup URL, auth cookie header,incognito, loader, modal, and offline wrapper unchanged.Small diff sketch:
To avoid regressions:
onOpenWindowand popup rendering with Android platform checks so iOS native keeps the exact current behavior.Cookie: authToken,incognito,FullPageOfflineBlockingView, and loader.What alternative solutions did you explore? (Optional)
Opening the QBO URL externally with
Linking.openURLcould bypass WebView popup handling, but it changes the existing authenticated in-app flow and risks losing the current cookie/header behavior. Reusing the already-merged HR OAuth popup pattern fixes the Android-specific root cause with a smaller blast radius.godzillaxbox19982014-lgtm commentedon Jun 22, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
[$250] QBO - Can't connect on Android app
What is the root cause of that problem?
I traced this to the path that handles
QBO, QuickBooks:QuickbooksAdvancedPage):const {bankAccounts, creditCards, otherCurrentAssetAccounts, vendors} = policy?.connections?.quickbooksOnline?.data ?? {};QuickbooksInvoiceAccountSelectPage):const {bankAccounts, otherCurrentAssetAccounts} = policy?.connections?.quickbooksOnline?.data ?? {};QuickbooksNonReimbursableCreditCardDefaultVendorSelectPage):function QuickbooksNonReimbursableCreditCardDefaultVendorSelectPage({policy}: WithPolicyConnectionsProps) {src/pages/workspace/accounting/qbo/advanced/QuickbooksAdvancedPage.tsx:37andsrc/pages/workspace/accounting/qbo/advanced/QuickbooksInvoiceAccountSelectPage.tsx:31do not agree on the sameQBO, QuickBooksvalue, so the user-visible path can show a missing or stale state even though nearby data already has the needed context.What changes do you think we should make in order to solve the problem?
src/pages/workspace/accounting/qbo/advanced/QuickbooksAdvancedPage.tsx:37to deriveQBO, QuickBooksfrom the card/accounting data source that owns this flow before the value is consumed.src/pages/workspace/accounting/qbo/advanced/QuickbooksInvoiceAccountSelectPage.tsx:31; that follows the safer family move to add fallback at the export/mapping layer, so the write/optimistic/read paths agree instead of only changing the visible component.What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
tests/unit/Payment*.tsfor the exact issue flow: [$250] QBO - Can't connect on Android app.src/pages/workspace/accounting/qbo/advanced/QuickbooksAdvancedPage.tsx:37so valid existingQBO, QuickBooksbehavior still works.What alternative solutions did you explore? (Optional)
QBO, QuickBooksconsistent at the first read/write boundary shown above.67 remaining items
melvin-bot commentedon Jul 29, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)melvin-bot commentedon Jul 29, 2026
Payment Summary
Upwork Job
BugZero Checklist (@mallenexpensify)
melvin-bot commentedon Aug 3, 2026
@mallenexpensify Eep! 4 days overdue now. Issues have feelings too...
mallenexpensify commentedon Aug 4, 2026
Payment Summary
Contributor+: @aimane-chnaif due $250 via NewDot
@aimane-chnaif plz complete the BZ checklist and tag me in a post once you have. Thx
aimane-chnaif commentedon Aug 4, 2026
@MelvinBot What is offending PR?
aimane-chnaif commentedon Aug 4, 2026
BugZero Checklist:
[Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to comment:
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion:
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue: https://github.com/Expensify/Expensify/issues/668598
Regression Test Proposal
Precondition:
Precondition: workspace with enabled Accounting feature.
Test:
Do we agree 👍 or 👎
Zapier Logs
Run ID: 00040eee-5f51-a5d0-e53d-f9e467e0baf4MelvinBot commentedon Aug 4, 2026
There isn't one — this wasn't introduced by any App PR, so there's no offending PR to point at.
The regression was an environment/infra change, not an App code change:
ConnectToQuickbooksOnlineFlow/index.native.tsx, which had not changed since April–May 2026 — yet the bug appeared new and reproduced in production. The migration to the sharedAccountingSetupWebViewPage(Migrate ConnectToQuickbooksOnlineFlow and ConnectToXeroFlow to @react-navigation modal screens #92512) landed on 2026‑06‑30, after this was reported, so it isn't the cause either.Cookie: authTokenheader, which is dropped on any redirect/interstitial hop. Once an extra hop was inserted in front of thewww.expensify.com/api/*command (server‑side risk/bot mitigation), the URL was re‑requested unauthenticated and the raw JSON command response rendered — the reported "blank tab with Autoformatting/Pretty‑print checkbox" is Android WebView's JSON viewer.The fix (#96768, and the Xero twin #95552) wasn't a revert — it added resilience by appending a short‑lived
authTokento the URL (shouldAppendShortLivedAuthToken) so auth survives redirects.For the BZ checklist: I'd mark the "offending PR" item N/A — there's no App PR to comment on. If you want a code‑side attribution for the record, the closest thing is the original design choice to authenticate these native accounting‑connect WebViews with a one‑shot
Cookieheader (predates the bug by many months), but that's not a regression‑introducing PR.garrettmknight commentedon Aug 7, 2026
$250 approved for @aimane-chnaif