Skip to content

[Due for payment 2026-05-11] Onboarding-Onboarding modal is not shown after redirecting from OD #89010

Closed

Description

@mitarachim

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 9.3.62-7
Reproducible in staging?: Yes
Reproducible in production?: No
If this was caught during regression testing, add the test name, ID and link from BrowserStack: https://test-management.browserstack.com/projects/2219752/folder/13176677/test-cases/41237671
Email or phone of affected tester (no customers): N/A
Issue reported by: Applause Internal Team
Bug source: Regression TC Execution
Device used: MacBook Air 15.7.4 Chrome
App Component: Other

Action Performed:

  1. Open a fresh incognito window
  2. Go to OD - staging.expensify.com
  3. Select "Manage my company's expenses 1-9"
  4. Sign up with a new account without a "+" ([anything]@tstsg.com)
  5. Click on "Get Started", then "Join"
  6. Verify that you are redirected to NewDot and the onboarding modal is displayed

Expected Result:

The onboarding modal is displayed for a new user after being redirected from OD

Actual Result:

Onboarding modal is not shown for a new user after redirecting from OD

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari

Screenshots/Videos

Bug7139559_1777319904060.No_onboarding_1.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @mallenexpensify

Activity

  1. added
    DeployBlockerCash
    Daily
    Bug
    DeployBlocker
    on Apr 28, 2026
  2. melvin-bot commented on Apr 28, 2026

    @melvin-bot

    Triggered auto assignment to @inimaga (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

  3. melvin-bot commented on Apr 28, 2026

    @melvin-bot

    💬 A slack conversation has been started in #expensify-open-source

  4. github-actions commented on Apr 28, 2026

    @github-actions
    Contributor

    👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  5. MelvinBot commented on Apr 28, 2026

    @MelvinBot
    Contributor

    Proposal

    What is the root cause of that problem?

    When a new user signs up on OldDot and gets redirected to NewDot via /transition, the onboarding modal is skipped due to the isInvitedOrGroupMember check in useOnboardingFlow.ts:86-91.

    OldDot's sign-up flow (selecting "Manage my company's expenses 1-9") sets nvp_introSelected with an inviteType, which makes wasInvitedToNewDotSelector return true. It may also create a workspace policy, making hasNonPersonalPolicy true. Either condition causes isInvitedOrGroupMember to be true, and the hook returns early at line 90 — never calling startOnboardingFlow().

    Additionally, the OnboardingGuard also skips onboarding because isTransitioning is true (the browser URL still contains "transition" after auth completes) and isInvitedOrGroupMember is also true at the guard level (line 173). So both mechanisms that could trigger onboarding are blocked.

    This is not reproducible in production because the current production build predates the code that introduced the isInvitedOrGroupMember skip in the useOnboardingFlowRouter hook and the new OnboardingGuard.

    What changes do you think we should make in order to solve the problem?

    The isInvitedOrGroupMember check in useOnboardingFlow.ts (line 88-90) should not skip onboarding for users who haven't completed it (hasCompletedGuidedSetupFlow === false). Users coming from OldDot sign-up with nvp_introSelected set still need to go through the NewDot onboarding flow.

    The fix should refine the skip condition so that isInvitedOrGroupMember only causes a skip when the user has actually completed onboarding or when the NVP_ONBOARDING data indicates they don't need it. One approach: check isOnboardingCompleted !== false before applying the isInvitedOrGroupMember early return in the hook. The same logic should be reviewed in OnboardingGuard.ts line 173/194 to ensure consistency.

    What alternative solutions did you explore? (Optional)

    An alternative would be to fix the isTransitioning check timing so that once auth completes and the URL updates from /transition, the guard properly re-evaluates and redirects to onboarding. However, this is fragile and depends on URL update timing. Fixing the isInvitedOrGroupMember logic directly is more reliable since it addresses the core semantic issue: OldDot sign-up users with inviteType set are not the same as users who were genuinely invited to a workspace by another user and don't need onboarding.

    Investigation details

    Data flow for the bug:

    1. User signs up on OldDot, selects "Manage my company's expenses 1-9"
    2. OldDot sets nvp_introSelected with inviteType and may create a workspace policy
    3. OldDot redirects to new.expensify.com/transition?shortLivedAuthToken=...
    4. LogInWithShortLivedAuthTokenPage authenticates the user
    5. AuthScreens mounts, useOnboardingFlowRouter hook runs
    6. OnboardingGuard evaluates: isTransitioning=true → shouldSkipOnboarding=true → ALLOW (no redirect)
    7. Hook evaluates: wasInvitedToNewDot=true (from nvp_introSelected.inviteType) → isInvitedOrGroupMember=true → early return at line 90
    8. startOnboardingFlow() is never called → onboarding modal never appears

    Key files:

    Confidence: High — the code path is clear and both skip mechanisms are well-documented in the source.

    Possibly related issue: Expensify/App#86498 — same symptom (onboarding not shown after OD redirect), reported in version 9.3.49-2 and reproducible in both staging and production. That issue may share the same root cause at the OnboardingGuard level, while this deploy blocker regression adds the isInvitedOrGroupMember skip in the hook as a second blocker.


    Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.

  6. OSBotify commented on Apr 28, 2026

    @OSBotify
    Contributor

    Investigation Summary

    Classification: Needs further investigation — may be Frontend or Backend bug
    Causing PR: No single PR identified with confidence
    Related Issues: None identified

    Recommendation: NEEDS INVESTIGATION

    The onboarding flow for OD-to-NewDot redirects on web involves multiple layers (OD backend, transition URL handling, LogInWithShortLivedAuthTokenPage, AuthScreensInitHandler, useOnboardingFlowRouter, and OnboardingGuard). None of the staging PRs I examined clearly broke this specific path.

    Assigned: None — no causing PR identified with sufficient confidence
    Labels: No label changes made — both DeployBlockerCash and DeployBlocker retained pending further investigation

    📋 Detailed Analysis

    Evidence

    Bug summary: After signing up on staging.expensify.com (OD) and being redirected to staging.new.expensify.com (NewDot web) as a new user, the onboarding modal does not appear. This is staging-only and is not reproducible in production.

    Platform: MacOS Chrome (web, not native HybridApp).

    Transition flow analyzed:

    1. User signs up on OD → OD issues a shortLivedAuthToken and redirects to /transition?shortLivedAuthToken=...&exitTo=...
    2. On the NewDot web side (CONFIG.IS_HYBRID_APP = false), LogInWithShortLivedAuthTokenPage (public screen) calls signInWithShortLivedAuthToken()
    3. After sign-in, SessionUtils.didUserLogInDuringSession() returns true → AuthScreensInitHandler calls App.openApp()
    4. useOnboardingFlowRouter() (in AuthScreens.tsx) runs after isLoadingApp becomes false
    5. startOnboardingFlow() should redirect the user to the onboarding modal

    Conditions that skip onboarding (in useOnboardingFlow.ts):

    The hook returns early if currentUrl.includes(ROUTES.TRANSITION_BETWEEN_APPS) && isLoggingInAsNewSessionUser. During the transition, this correctly blocks onboarding. After the URL changes to HOME, the hook should re-run and trigger onboarding.

    The hook also skips onboarding if hasNonPersonalPolicy is true. For the "Manage my company's expenses 1-9" sign-up path, OD may automatically create a workspace/policy, which would set hasNonPersonalPolicy: true in the openApp response, causing the hook to skip onboarding permanently.

    OnboardingGuard conditions (in OnboardingGuard.ts): Similar conditions — isInvitedOrGroupMember = (!CONFIG.IS_HYBRID_APP && (hasNonPersonalPolicy || wasInvitedToNewDot)) would also skip the guard redirect if hasNonPersonalPolicy is true.

    Verification

    Files involved in the flow:

    • /src/pages/LogInWithShortLivedAuthTokenPage.tsx — handles transition URL authentication
    • /src/libs/Navigation/AppNavigator/AuthScreensInitHandler.tsx — calls openApp() after sign-in
    • /src/hooks/useOnboardingFlow.ts — triggers onboarding via startOnboardingFlow()
    • /src/libs/Navigation/guards/OnboardingGuard.ts — guards navigation to redirect to onboarding

    Staging PRs examined that touch related code:

    None of the examined PRs directly break the OD-to-NewDot web onboarding flow with high confidence.

    Root Cause

    Hypothesis 1 (Backend): The OD staging environment may have changed how it creates accounts for the "Manage my company's expenses 1-9" path, resulting in the user having hasNonPersonalPolicy: true in the OpenApp response. This would cause both useOnboardingFlowRouter and OnboardingGuard to skip onboarding, since the user appears to already be part of a non-personal workspace. If this is the case, the fix would require investigation on the OD/API side, not in the App.

    Hypothesis 2 (Frontend): A timing issue in the new-user sign-in flow causes the onboarding to be skipped. After signInWithShortLivedAuthToken, the useOnboardingFlow hook checks isLoggingInAsNewSessionUser against the current URL. If sessionEmail updates before currentUrl clears the transition path, the check paramsEmail === sessionEmail would be true, making isLoggingInAsNewUser return false. This would not block onboarding, so timing alone shouldn't prevent it.

    Recommended next steps:

    1. Confirm what hasNonPersonalPolicy value is set to in the OpenApp response for a new user from the "Manage my company's expenses 1-9" path on staging vs production
    2. Check if the OD staging environment recently changed account creation behavior for company-size selections
    3. Add logging in useOnboardingFlow.ts to capture which condition is causing the early return
    4. Tag @mountiny (author of PR Fix infinite onboarding navigation loop crash on iOS #88014) and @MelvinBot (assigned) for their knowledge of the OnboardingGuard
  7. amyevans commented on Apr 28, 2026

    @amyevans
    Contributor

    Looks like a FE PR was identified: #85234 (comment), so removing the DeployBlocker label

  8. 38 remaining items

  9. changed the title [-][Due for payment 2026-05-11] [Due for payment 2026-05-07] Onboarding-Onboarding modal is not shown after redirecting from OD[/-] [+][Due for payment 2026-05-11] Onboarding-Onboarding modal is not shown after redirecting from OD[/+] on May 7, 2026
  10. melvin-bot commented on May 8, 2026

    @melvin-bot

    @mallenexpensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  11. added
    Daily
    and removed
    Daily
    on May 11, 2026
  12. melvin-bot commented on May 11, 2026

    @melvin-bot

    Payment Summary

    Upwork Job

    BugZero Checklist (@mallenexpensify)

    • (if NewFeature) I have created a PR for any necessary HelpDot updates, or I confirmed no updates are necessary.
    • I have verified the correct assignees and roles are listed above and updated the necessary manual offers
    • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants//hired)
    • I have verified the PR was not reverted
    • I have applied any discounts due to bugs/regressions introduced by this PR
    • I have paid out the Upwork contracts or cancelled the ones that are incorrect
    • I have verified the payment summary above is correct
  13. mallenexpensify commented on May 12, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor+: @Krishna2323 due $250 via NewDot
    Contributor+: @mkhutornyi due $250 via NewDot

    Think we're good here, comment/reopen if not

  14. Krishna2323 commented on May 15, 2026

    @Krishna2323
    Contributor

    Requested in ND.

  15. laurenreidexpensify commented on May 19, 2026

    @laurenreidexpensify
    Contributor

    $250 approved for @Krishna2323

  16. trjExpensify commented on Jun 2, 2026

    @trjExpensify
    Contributor

    approved $250 for @mkhutornyi

  17. marufsharifi commented on Jun 16, 2026

    @marufsharifi
    Contributor

    This issue was introduced by the PR of this issue. Users who are invited to a workspace before completing onboarding are incorrectly shown the onboarding modal when they log back in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentBugDaily

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions