Fix blank Xero setup WebView on Android by loading an authenticated setup URL - #95552
neil-marcellini merged 3 commits into
Conversation
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@codex review |
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
Reviewer Checklist
Screenshots/VideosAndroid: HybridApp95552_android_native.movAndroid: mWeb ChromeiOS: HybridApp95552_ios_native.moviOS: mWeb SafariMacOS: Chrome / Safari95552_web_chrome.mov |
neil-marcellini
left a comment
There was a problem hiding this comment.
Great work, especially on the automated tests!
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 neil-marcellini has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/neil-marcellini in version: 9.4.34-0 🚀
|
Help site review — no changes requiredI reviewed the changes in this PR against the help site files under Why: This is an internal bug fix. On Android/iOS native, connecting a workspace to Xero opened a blank page because the setup WebView loaded the raw The existing article already documents the intended (now-restored) flow:
Since the documented behavior is unchanged, there's nothing to add or correct, and I have not opened a draft docs PR. Files changed in this PR (all code/tests — none user-facing docs)
If you believe a doc should be added or updated (e.g., a mobile-specific note), reply with @KJ21-ENG, please review the linked help site PR and confirm it reflects the current behavior. Then mark the linked help site PR |
|
Hi @KJ21-ENG. The PR was failed by the QA team because, although Xero is working as expected, the original issue still occurs in QBO. 1784056232509.WhatsApp_Video_2026-07-14_at_3.05.49_PM__1_.mp4 |
|
Thanks for testing. The QBO behavior shown here appears to be the existing issue tracked in #94142, not a regression introduced by this PR. The approved #95199 proposal is Xero-specific and explicitly allows the shared WebView change to be opt-in; accordingly, this PR intentionally leaves QBO unchanged and adds a regression test proving that behavior. @neil-marcellini @brunovjk, could you confirm whether you want #95552 formally expanded to cover #94142 as well? If so, I can update the implementation, tests, PR description, and linked fixed issues accordingly. |
|
🚀 Deployed to production by https://github.com/roryabraham in version: 9.4.34-14 🚀
|
|
🚀 Deployed to production by https://github.com/roryabraham in version: 9.4.34-14 🚀
Bundle Size Analysis (Sentry): |
Waiting for @neil-marcellini On this. Thanks! |
|
To be fair, I suggest to fix QBO issue separately as issue was already created before #95199 (which this PR fixes) and proposals were reviewed. cc: @neil-marcellini |
Sounds good, go for it! |
Explanation of Change
On Android, connecting a workspace to Xero opened a blank page (with a small "Pretty-print" toolbar) instead of the Xero authorization UI. The native Xero setup screen passed the raw
getXeroSetupLink(policyID)value — the OldDotConnectPolicyToXerocommand URL — straight into theAccountingSetupWebViewPageincognito WebView, which only supplied auth as a first-requestCookieheader, so the WebView rendered the raw command response instead of an authenticated setup flow.This PR makes the native Xero setup WebView load an authenticated URL, the same way other native OldDot handoffs (e.g.
ConnectToHRFlow) do:AccountingSetupWebViewPagegains an opt-inshouldAppendShortLivedAuthTokenprop. When set, the page resolvesgetShortLivedAuthTokenURL(uri)before mounting the WebView and shows the existing loading indicator while the token request is in flight. If the token request fails while online, the helper falls back to the original link so the page does not hang in the loading state (the WebView then behaves as it did before this fix).ConnectToHRFlow, the page skips the token request while offline and fetches it on reconnect (useNetwork({onReconnect})with a fetch-once ref), so opening the page offline and then reconnecting still ends up on the authenticated URL.XeroSetupPagepassesshouldAppendShortLivedAuthToken, so its WebView now loadsgetXeroSetupLink(policyID)with a short-livedauthTokenappended and the Xero authorization UI renders.AccountingSetupWebViewPagebut does not pass the new prop, so its setup WebView keeps mounting immediately with the unmodifieduri— behavior there is unchanged by construction.getShortLivedAuthTokenURL()and verifies the WebView receives the authenticated URL (not the rawgetXeroSetupLink()value), that the loading indicator shows until it resolves, and that an offline mount defers the token request until reconnect. The QBO setup test now verifies the token helper is not called and the WebView mounts immediately with the raw setup link.Fixed Issues
$ #95199
PROPOSAL: #95199 (comment)
Tests
Offline tests
Connecting an accounting integration requires being online; the setup WebView is wrapped in
FullPageOfflineBlockingView, which is unchanged. The short-lived token request is skipped while offline and retried on reconnect.QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)Avatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari