fix: iOS - Copilot - App returns to login page after removing copilot - #86844
Conversation
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f1333d66ff
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
|
Should we be concerned with the brief flash of the member upon removal? |
trjExpensify
left a comment
There was a problem hiding this comment.
Looks good, much more graceful. 👍
This comment was marked as outdated.
This comment was marked as outdated.
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppCleanShot.2026-04-06.at.21.47.23.5.mp4Android: mWeb ChromeCleanShot.2026-04-06.at.21.44.29.4.mp4CleanShot.2026-04-06.at.21.48.56.6.mp4Fixed on 11 Apr CleanShot.2026-04-13.at.20.28.14.1.mp4iOS: HybridAppCleanShot.2026-04-06.at.21.42.50.3.mp4iOS: mWeb SafariCleanShot.2026-04-06.at.21.37.00.2.mp4MacOS: Chrome / SafariCleanShot.2026-04-06.at.21.33.37.1.mp4 |
@TaduJR I just double-checked after merging with the latest main. The current behavior still looks good on all platforms, except on Android mWeb, where it still briefly flashes to the login screen. Android: mWeb ChromeCleanShot.2026-04-06.at.21.44.29.4.mp4CleanShot.2026-04-06.at.21.48.56.6.mp4 |
…ilot-App-returns-to-login-page-after-removing-copilot
Confirmed — this issue was fixed on latest PR |
|
🚧 @mollfpr 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! 🧪🧪
|
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/mollfpr in version: 9.3.59-0 🚀
Bundle Size Analysis (Sentry): |
|
No help site changes are required for this PR. The changes are purely internal bug fixes to session state management (preserving The existing help site articles already accurately describe the copilot flows: |
|
🚀 Deployed to production by https://github.com/AndrewGable in version: 9.3.59-4 🚀
|
Explanation of Change
When a delegate removes themselves as copilot, the server returns
jsonCode: 408which theHandleDeletedAccountmiddleware handles by callingsignOutAndRedirectToSignIn. The existing code path callsredirectToSignIn()(which clears SESSION) thenOnyx.multiSet()(which restores it), creating a ~730ms window where the login page flashes.This PR adds a new branch in
signOutAndRedirectToSignInthat usesOnyx.clear(KEYS_TO_PRESERVE_SUPPORTAL)preserving SESSION during the clear then restores the stashed session viaOnyx.multiSet, matching the existing supportal flow pattern. This eliminates the flash.It also adds
STASHED_SESSIONandSTASHED_CREDENTIALStoKEYS_TO_PRESERVEinApp.tsso that Clear Cache doesn't destroy delegate recovery data, which previously caused permanent logout.Fixed Issues
$ #84186
PROPOSAL: #84186 (comment)
Tests
Based on the issue, there are two test cases:
Tests
Case 1: Removing copilot without Clear Cache
Case 2: Removing copilot after Clear Cache
Offline tests
Same as tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, 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.ScrollViewcomponent to make it scrollable when more elements are added to the page.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-Native.mp4
Android: mWeb Chrome
Android-mWeb.mp4
iOS: Native
iOS-Native-1.mp4
iOS-Native-2.mp4
iOS: mWeb Safari
iOS-Safari.mp4
MacOS: Chrome / Safari
Mac-Chrome-1.mp4
Mac-Chrome-2.mp4