Fix onboarding flow not appearing after anonymous sign-in from public room thread#85660
Fix onboarding flow not appearing after anonymous sign-in from public room thread#85660
Conversation
…gn-in When an anonymous user signs in via the SignInModal (e.g. "Reply in thread" in a public room), Navigation.dismissModal() and openApp() were firing in parallel. The dismiss triggered the OnboardingGuard while IS_LOADING_APP was still true, causing it to skip the onboarding redirect entirely. Now we ensure openApp(true) fully completes (IS_LOADING_APP transitions to false, NVP_ONBOARDING is loaded) before dismissing the modal, so the OnboardingGuard evaluates with accurate data and properly redirects new users to onboarding. Co-authored-by: Eric Han <eh2077@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. |
|
@MelvinBot Can you add unit test to cover the change? |
Tests cover: - Anonymous users don't trigger openApp or dismissModal - Non-anonymous users trigger openApp then dismissModal - dismissModal waits for both openApp chain and isNavigationReady (Promise.all) - Session transition from anonymous to authenticated triggers the correct flow Co-authored-by: Eric Han <eh2077@users.noreply.github.com>
|
Added unit tests for the
|
Co-authored-by: Eric Han <eh2077@users.noreply.github.com>
|
Fixed the failing Prettier check: ran prettier on |
- Add type-safe casts for require() calls inside jest.mock factories - Add eslint-disable comments for __esModule naming convention - Add file-level disable for no-non-null-assertion - Use React.createElement instead of JSX in mock factories Co-authored-by: Eric Han <eh2077@users.noreply.github.com>
|
Fixed the failing ESLint check in
|
Co-authored-by: Eric Han <eh2077@users.noreply.github.com>
|
Fixed the failing checks in
|
Co-authored-by: Eric Han <eh2077@users.noreply.github.com>
|
Fixed the failing |
Co-authored-by: Eric Han <eh2077@users.noreply.github.com>
|
Fixed the failing |
- Add missing `flush` export to SequentialQueue mock (Network module imports it during initialization) - Mock `useSession` from OnyxListItemProvider to avoid requiring the full context provider tree in unit tests - Update tests to set session data via the mock instead of Onyx.merge Co-authored-by: Eric Han <eh2077@users.noreply.github.com>
|
Fixed the failing
|
Co-authored-by: Eric Han <eh2077@users.noreply.github.com>
|
Fixed the failing |
The inline mock factory for @libs/actions/App was not properly overriding the manual __mocks__/App.ts mock. Switch to defining jest.fn() directly in the factory and importing from the mocked module, matching the pattern used by other tests (e.g. useConfirmReadyToOpenApp.test.ts). Co-authored-by: Eric Han <eh2077@users.noreply.github.com>
|
Fixed the failing |
Co-authored-by: Eric Han <eh2077@users.noreply.github.com>
|
Fixed the failing test in Changed the mock to use wrapper functions ( |
Remove __esModule/default wrapper from Navigation mock (matching all other test files) and use block bodies to avoid returning any values that trigger no-unsafe-return ESLint errors. Co-authored-by: Eric Han <eh2077@users.noreply.github.com>
|
Fixed the failing checks:
|
|
The failing checks are:
|
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
Rerunning the tests |
|
The failing checks are unrelated to this PR's changes.
|
|
@eh2077 can you pull main |
|
@MelvinBot Can you merge with main branch? If not, then I can help |
…fterAnonymousSignIn Co-authored-by: Eric Han <eh2077@users.noreply.github.com>
|
Merged main into this branch — no conflicts. |
|
The only non-checklist failing check is Reassure Performance Tests, which is failing due to a This is unrelated to this PR's changes. This PR only modifies The latest checks (after the merge with main) are currently still in progress — all completed checks so far are passing. |
|
The failing Analysis: The job had zero steps and timed out at exactly 10 minutes, meaning the runner never allocated or initialized. This is a transient CI runner problem, not a code failure. Evidence: This PR only modifies The other failing check ( Recommendation: Re-run the failed |
|
🚧 @JS00001 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/JS00001 in version: 9.3.44-0 🚀
Bundle Size Analysis (Sentry): |
|
🚀 Deployed to staging by https://github.com/JS00001 in version: 9.3.47-0 🚀
Bundle Size Analysis (Sentry): |
|
@eh2077 For some reason public room didn't display after sign in Screenrecording.03-26-2026.4-59-29.Am.1.mp4 |
|
Hmm, it worked for me when testing #85660 (comment) |
|
@izarutskaya Are you able to reproduce it consistently? |
|
Another tester also cann't see room after sign in 1774496144497.retest.mp4 |
|
This also caused the sign-in modal not to close web.mp4 |
|
Thanks for your comments, going to revert it to unblock issues. |
|
🚀 Deployed to production by https://github.com/grgia in version: 9.3.48-2 🚀
|
|
🚀 Deployed to staging by https://github.com/JS00001 in version: 9.3.49-0 🚀
Bundle Size Analysis (Sentry): |
|
🚀 Deployed to production by https://github.com/grgia in version: 9.3.49-2 🚀
|
Explanation of Change
When an anonymous user signs in via the SignInModal (e.g., tapping "Reply in thread" in a public room),
Navigation.dismissModal()andopenApp()were firing in parallel. The dismiss triggered theOnboardingGuardwhileIS_LOADING_APPwas stilltrue, causing the guard to skip the onboarding redirect entirely. This left new users stuck without onboarding and with an infinite loading state on the Inbox.This PR fixes the issue by ensuring
openApp(true)fully completes (soIS_LOADING_APPtransitions tofalseandNVP_ONBOARDINGis loaded) before dismissing the modal. This way, whendismissModal()triggers theOnboardingGuard, it evaluates with accurate data and properly redirects new users to onboarding.The fix uses
Promise.allto runopenApp(with its queue idle waits) andNavigation.isNavigationReady()concurrently, only callingdismissModal()after both complete.Fixed Issues
$ #83092
PROPOSAL: #83092 (comment)
Tests
Offline tests
QA Steps
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./** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari