Repository navigation
Fix HybridApp sign-out after server clears the session - #107591
Conversation
Co-authored-by: TaduJR <TaduJR@users.noreply.github.com>
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.
|
|
🤖 Android test steps verification results: ❌ fail Testing was blocked before device interaction because CI cannot obtain the valid magic code required to reopen the account. No account was closed, no screenshots were captured, and no test recording was verified; this is not a confirmed product failure. PR build provenance was unverified, and the available Android environment is standalone NewDot—not HybridApp/OldDot.
|
|
🤖 Web test steps verification results: ❌ fail Account reopening could not be tested because the required emailed magic code is inaccessible; the test account was left open and signed in. Only the existing web session was inspected: the running PR build was not independently verified, and HybridApp behavior remains untested.
view run · no recording available |
|
@MelvinBot please make one change on this PR, then push. Don't change anything else.
In -export {
- getHybridAppSettings,
- setReadyToShowAuthScreens,
- resetSignInFlow,
- getResetSignInFlowUpdate,
- setUseNewDotSignInPage,
- closeReactNativeApp,
- signOutFromOldDot,
- signOutFromOldDotAndRestartSignIn,
-};
+export {getHybridAppSettings, setReadyToShowAuthScreens, getResetSignInFlowUpdate, setUseNewDotSignInPage, closeReactNativeApp, signOutFromOldDot, signOutFromOldDotAndRestartSignIn}; |
|
Please update the description with the below DescriptionExplanation of ChangeWhen you close your account in the mobile app, the server signs you out by clearing all of the app's stored data (Onyx). That clear also wipes two HybridApp values the sign-in flow checks, Closing an account also left Expensify Classic signed in. The Classic sign-out was in a This replaces #105535, which was reverted for #105679. #105535 moved the Classic sign-out out of the normal sign-out path and into a listener that only ran when a clear removed stored HybridApp data. On a fresh install, the first-launch clear runs before that data exists, so Classic was no longer signed out there. That sign-out is what removes a placeholder user Classic creates at startup. Without it, Classic skips loading the new account, including the setting that keeps it in New Expensify, and the next launch opens Classic. What this PR does:
Fixed Issues$ #102528 TestsTest 1: Close an account and sign back in
Test 2: A wrong code doesn't close the account
Test 3: Open the app again after closing an account
Test 4: Fresh install with a new account
Test 5: Close one account and sign in to another Before you start, check that account B shows Switch to Expensify Classic on its Account page. If it doesn't, skip this test and note it. On a dev build, any account has this option under Account > Troubleshoot.
Test 6: Normal sign out
Test 7: Switching accounts as a copilot Use an account that was added as a copilot on another account.
Offline testsSame as tests QA StepsSame as tests
PR Author Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb ChromeiOS: NativeiOS: mWeb SafariMacOS: Chrome / Safari |
Co-authored-by: TaduJR <TaduJR@users.noreply.github.com>
|
|
|
Please update the description with the below DescriptionExplanation of ChangeWhen you close your account in the mobile app, the server signs you out by clearing all of the app's stored data (Onyx). That clear also wipes two HybridApp values the sign-in flow checks, Closing an account also left Expensify Classic signed in. The Classic sign-out was in a This replaces #105535, which was reverted for #105679. #105535 moved the Classic sign-out out of the normal sign-out path and into a listener that only ran when a clear removed stored HybridApp data. On a fresh install, the first-launch clear runs before that data exists, so Classic was no longer signed out there. That sign-out is what removes a placeholder user Classic creates at startup. Without it, Classic skips loading the new account, including the setting that keeps it in New Expensify, and the next launch opens Classic. What this PR does:
Fixed Issues$ #102528 TestsTest 1: Close an account and sign back in
Test 2: A wrong code doesn't close the account
Test 3: Open the app again after closing an account
Test 4: Fresh install with a new account
Test 5: Close one account and sign in to another Before you start, check that account B shows Switch to Expensify Classic on its Account page. If it doesn't, skip this test and note it. On a dev build, any account has this option under Account > Troubleshoot.
Test 6: Normal sign out
Test 7: Switching accounts as a copilot Use an account that was added as a copilot on another account.
Offline testsSame as tests QA StepsSame as tests
PR Author Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb ChromeiOS: NativeiOS: mWeb SafariMacOS: Chrome / Safari |
|
Updated the PR description with your supplied text, test steps, and checked checklist. No code changes made. |
|
Verified the PR description already matches your supplied text, test steps, and checked checklist. No further changes needed. |
|
@MelvinBot Please replace the Tests with the below one DetailsTest 1: Close an account and sign back in
Test 2: A wrong code doesn't close the account
Test 3: Open the app again after closing an account
Test 4: Fresh install with a new account
Test 5: Close one account and sign in to another Before you start, check that account B shows Switch to Expensify Classic on its Account page. If it doesn't, skip this test and note it. On a dev build, any account has this option under Account > Troubleshoot.
Test 6: Normal sign out
Test 7: Switching accounts as a copilot Use an account that was added as a copilot on another account.
|
|
Updated the Tests section with your revised steps. Everything else is unchanged. |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid-Native.mp4Android: mWeb ChromeiOS: HybridAppiOS-Native.mp4iOS: mWeb SafariMacOS: Chrome / Safari |
|
Please make the PR ready. |
|
Marked the PR as ready for review. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@MelvinBot Please merge main |
Co-authored-by: TaduJR <TaduJR@users.noreply.github.com>
|
|
|
All yours @mollfpr Thanks! |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 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! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/mollfpr in version: 9.5.53-0 🚀
|
|
No help site update needed — this PR restores expected sign-out and sign-in behavior after account closure without introducing a new workflow or making existing help instructions incorrect. |
|
🚀 Deployed to production by https://github.com/arosiclair in version: 9.5.53-3 🚀
Bundle Size Analysis (Sentry): |

Explanation of Change
When you close your account in the mobile app, the server signs you out by clearing all of the app's stored data (Onyx). That clear also wipes two HybridApp values the sign-in flow checks,
useNewDotSignInPageandreadyToShowAuthScreens, and nothing set them again. So when you came back and entered a valid magic code, the sign-in went through, but the app stayed on the code screen. Tapping Sign In again sent the same, now used, code, which is why you saw "Incorrect magic code".Closing an account also left Expensify Classic signed in. The Classic sign-out was in a
.thenonAPI.write, and a write resolves as soon as it's queued, without the response, so that code never ran.This replaces #105535, which was reverted for #105679. #105535 moved the Classic sign-out out of the normal sign-out path and into a listener that only ran when a clear removed stored HybridApp data. On a fresh install, the first-launch clear runs before that data exists, so Classic was no longer signed out there. That sign-out is what removes a placeholder user Classic creates at startup. Without it, Classic skips loading the new account, including the setting that keeps it in New Expensify, and the next launch opens Classic.
What this PR does:
clearStorageAndRedirect) behaves exactly as onmain, including on a fresh install. Its two HybridApp steps now live in one shared function.closeAccountdrops the.thenthat never ran.tests/actions/HybridAppSignOutTest.tscover closing an account and signing back in, a rejected code, failures while applying the clear, clears from Pusher and push notifications, and the fresh-install case from New user-Refreshing the app with unvalidated account signed in redirects to Classic #105679.Fixed Issues
$ #102528
PROPOSAL: #102528 (comment)
Tests
Test 1: Close an account and sign back in
Test 2: A wrong code doesn't close the account
Test 3: Open the app again after closing an account
Test 4: Fresh install with a new account
Test 5: Close one account and sign in to another
Before you start, check that account B shows Switch to Expensify Classic on its Account page. If it doesn't, skip this test and note it. On a dev build, any account has this option under Account > Troubleshoot.
Test 6: Normal sign out
Test 7: Switching accounts as a copilot
Use an account that was added as a copilot on another account.
Offline tests
Same as tests
QA Steps
Same as tests
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