Skip to content

[$250] Onboarding modals can get stuck in a navigation loop, and refreshing to escape causes tasks to show "unexpected error" #85454

Description

@mountiny

Thread here.

Problem

There are two related problems during the onboarding flow:

1. Navigation loop on onboarding modals

When signing up with a "Manage Team" path (10+ employees), the onboarding modal can get stuck in a loop, cycling between steps (e.g., repeatedly showing the accounting software selection screen) instead of progressing to completion. The loop prevents the user from reaching the Test Drive step. Refreshing the page breaks the loop and allows onboarding to continue.

This has been observed by multiple users and appears to be intermittent -- subsequent signups with the same flow may work fine.

2. "Unexpected error" on onboarding tasks after refresh

After refreshing to escape the loop, the onboarding tasks (Guided Setup) display "Unexpected error posting the comment. Please try again later." This happens because the OPEN_REPORT request carrying guidedSetupData either fails or is interrupted by the refresh, causing the failure data to be applied to each task's report action.

Likely Root Cause

The loop is most likely caused by a race condition in getOnboardingInitialPath() in src/libs/actions/Welcome/OnboardingFlow.ts:

  • When the OnboardingGuard runs on navigation, it calls getOnboardingInitialPath() to determine where to redirect.
  • The guard checks whether onboardingPurposeSelected and onboardingCompanySize match the current path. If onboardingInitialPath points to /onboarding/employees or /onboarding/accounting but the purpose/company-size Onyx values are stale or not yet persisted, the guard redirects back to /onboarding/purpose.
  • On the next navigation event, the guard runs again with the same stale state, creating a redirect loop.
  • The ONBOARDING_LAST_VISITED_PATH key (updated in src/libs/Navigation/NavigationRoot.tsx) may also contribute by persisting a path that triggers the redirect cycle.

The task errors come from failure handling in prepareOnboardingOnyxData() in src/libs/ReportUtils.ts, which applies report.genericAddCommentFailureMessage to each task report action when the OPEN_REPORT request fails.

Key Files

Steps to Reproduce

  1. Create a new account on web
  2. Choose "Manage a team" purpose
  3. Select "10+" employees (or possibly other sizes)
  4. Progress through onboarding modals
  5. Observe the modal may loop (cycling back to accounting or earlier steps) instead of progressing to Test Drive
  6. Refresh the page to break the loop
  7. Observe onboarding tasks now show "Unexpected error posting the comment"

Note: This is intermittent and may not reproduce on every attempt.

Expected Behavior

  • Onboarding modals should progress linearly without looping
  • If a refresh is needed, onboarding tasks should not show errors (the guided setup request should be retried or errors should be cleared)

Platforms

  • Web (confirmed)
  • Mobile (not yet confirmed)
Issue OwnerCurrent Issue Owner: @linhvovan29546
Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~022033637307162175700
  • Upwork Job ID: 2033637307162175700
  • Last Price Increase: 2026-03-16

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.ExternalAdded to denote the issue can be worked on by a contributorHelp WantedApply this label when an issue is open to proposals by contributorsMonthlyKSv2ReviewingHas a PR in review

Type

No type

Fields

No fields configured for issues without a type.

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions