Repository navigation
Restart the HybridApp sign-in flow after closing an account - #105535
Conversation
The server clears Onyx when CloseAccount succeeds, which wipes the HybridApp sign-in flags. Reopening the account then left the user stuck on the magic code page. Apply the reset as successData so it lands after that clear. Co-authored-by: TaduJR <TaduJR@users.noreply.github.com>
|
I created this PR from an upstream branch since I don't have push access to your fork. To take ownership of this branch and be able to push updates, run: Then you can close this PR and open a new one from your fork. |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
🤖 Web test steps verification results: This PR has no written Tests steps yet, so I used the linked issue's steps. On Web, the Close account page works up to the confirm button. I could not run the close-and-reopen steps: they need a sign-out and a magic code from email, which automated testing can't do. The fix also targets HybridApp only, so iOS or Android testing by a human is still needed.
view run · no recording available |
This comment was marked as resolved.
This comment was marked as resolved.
…emoves the hybridApp key Closing an account ends the session through the server's clear, which never reached the HybridApp half of sign-out. Move the OldDot sign-out and sign-in reset into the HYBRID_APP connection so every clear that ends the session runs it, and drop the successData and the closeAccount .then that never ran. Co-authored-by: TaduJR <TaduJR@users.noreply.github.com>
|
@codex review |
Codex Review SummaryThis 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. |
|
I reworked the PR as you described and pushed a4c5fd6. The diff against
I also updated the PR description to match. I couldn't run Jest, typecheck, or lint in this run, so CI is the first run of the new tests. I didn't run a Web check either: this code only runs on HybridApp, and automated tests can't close an account or sign out. |
|
Codex Review: Didn't find any major issues. Bravo. 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". |
|
@MelvinBot Please update the replace the description with the below on in the details Also Please test on below all tests for verification results on your side DescriptionExplanation of ChangeClosing an account on iOS or Android left the user unable to sign back in. A successful OldDot also stayed signed in to the closed account. Normal sign-out handles both in Clears that keep the user signed in, like switching to a copilot, already preserve Fixed Issues$ #102528 TestsTest 1: Close an account and sign back in
Test 2: A wrong code does not close the account
Test 3: Reopen the app after closing an account
Test 4: Close one account and sign in to another Account B must show Switch to Expensify Classic on its Account page. If it doesn't, skip this test and note it.
Test 5: Normal sign out
Test 6: 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 |
|
🤖 Android test steps verification results: I replaced the PR description with your text. On Android, I could only run the first part of Test 1: the Close account page, both inputs, and the confirmation popup all work. The other steps need a completed account closure, a sign-out, magic codes from email, a second account, or a copilot account, so the automated tester skipped them. This emulator also runs standalone NewDot, not HybridApp, so a human still needs to run Tests 1–6 on the HybridApp build.
|
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / SafariAndroid-Native.mp4 |
This comment was marked as resolved.
This comment was marked as resolved.
|
I updated the PR description. There are no code changes.
QA Steps still says "Same as tests". |
|
Please make the PR ready for review |
|
I marked this PR as ready for review. |
|
🚧 mollfpr has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 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.28-4 🚀
|
|
No help site update needed. This PR fixes a mobile bug where you couldn't sign back in after closing your account, so the app now works the way users already expect and no article sentence becomes incorrect. |
|
Deploy Blocker #105679 was identified to be related to this PR. |
|
🚀 Deployed to staging by https://github.com/mollfpr in version: 9.5.30-0 🚀
|
|
🚀 Deployed to production by https://github.com/blimpich in version: 9.5.30-0 🚀
Bundle Size Analysis (Sentry): |










Explanation of Change
Closing an account on iOS or Android left the user unable to sign back in. A successful
CloseAccountresponse clears all Onyx data, including thehybridAppflags the sign-in flow needs, and nothing restored them. So a valid magic code signed the user in, but the app stayed on the magic code screen. Tapping Sign in then resent the used code and showed an incorrect code error.OldDot also stayed signed in to the closed account.
closeAccountonly signed it out after checking the response fromAPI.write, butAPI.writeresolves when the request is queued, with no response, so that sign-out never ran. Once sign-in works again, the next session would go to an OldDot still holding the closed account, so this is fixed here too.Normal sign-out handles both in
clearStorageAndRedirect, but closing an account never goes through it. This PR moves that work to the existinghybridAppconnection insrc/libs/HybridApp.ts, which now signs OldDot out and restarts the sign-in flow whenever a clear removes that key. One place now handles both normal sign-out and closing an account, andcloseAccountgoes back to a plainAPI.write.Clears that keep the user signed in, like switching to a copilot, already preserve
hybridApp, so they don't trigger this. A rejected validate code sends no clear, so both apps stay signed in.Fixed Issues
$ #102528
PROPOSAL: #102528 (comment)
Tests
Test 1: Close an account and sign back in
Test 2: A wrong code does not close the account
Test 3: Reopen the app after closing an account
Test 4: Close one account and sign in to another
Account B must show Switch to Expensify Classic on its Account page. Check this before closing account A. If it doesn't show it, skip this test and note it. On a dev build, any account can use the same option under Account > Troubleshoot.
Test 5: Normal sign out
Test 6: Switching accounts as a copilot
Use an account that was added as a copilot on another account.
Offline tests
These steps need a connection, because they use emailed codes and server responses.
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