fix(onboarding): keep skip completion moving after task sync failure#1771
Conversation
📝 WalkthroughWalkthroughThe PR adds error resilience to onboarding completion by wrapping task persistence in a try/catch block within ChangesOnboarding Task Persistence Error Handling
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
app/src/pages/onboarding/__tests__/OnboardingLayout.test.tsx (1)
232-247: 💤 Low valueConsider asserting the warning was logged.
The test correctly verifies that onboarding completes despite task persistence failure, but it doesn't assert that
console.warnwas actually called. Adding this assertion would provide complete coverage of the catch block's behavior.✅ Optional assertion to add
expect(mockSetOnboardingCompletedFlag).toHaveBeenCalledWith(true); expect(screen.getByTestId('home-page')).toBeInTheDocument(); + expect(warnSpy).toHaveBeenCalledWith( + '[onboarding] Failed to persist onboarding tasks; continuing completion', + expect.any(Error) + ); warnSpy.mockRestore();🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@app/src/pages/onboarding/__tests__/OnboardingLayout.test.tsx` around lines 232 - 247, The test "still completes onboarding when persisting onboarding tasks fails" sets up a console.warn spy (warnSpy) but never asserts it was called; update the test to assert that the warnSpy was invoked after clicking the 'complete-btn' (e.g., expect(warnSpy).toHaveBeenCalled() or toHaveBeenCalledWith a message containing the rejection/error), keeping the existing mockSetOnboardingTasks rejection and other assertions intact so the catch path in the onboarding completion flow is fully covered.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@app/src/pages/onboarding/__tests__/OnboardingLayout.test.tsx`:
- Around line 232-247: The test "still completes onboarding when persisting
onboarding tasks fails" sets up a console.warn spy (warnSpy) but never asserts
it was called; update the test to assert that the warnSpy was invoked after
clicking the 'complete-btn' (e.g., expect(warnSpy).toHaveBeenCalled() or
toHaveBeenCalledWith a message containing the rejection/error), keeping the
existing mockSetOnboardingTasks rejection and other assertions intact so the
catch path in the onboarding completion flow is fully covered.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: da704e4f-6c51-4d35-aa07-3a93b6e88ee3
📒 Files selected for processing (2)
app/src/pages/onboarding/OnboardingLayout.tsxapp/src/pages/onboarding/__tests__/OnboardingLayout.test.tsx
Summary
openhuman.app_state_snapshot timed out after 30000msfailure path.Problem
setOnboardingTaskspersists onboarding metadata and refreshes core local state; that refresh can callopenhuman.app_state_snapshotand time out.completeAndExitstopped before setting the onboarding completed flag or navigating home.Solution
setOnboardingCompletedFlag(true), walkthrough state, and navigation.setOnboardingTaskswith the reported timeout and asserts onboarding still completes.Submission Checklist
## Related- N/A: no matrix feature IDs changed.docs/RELEASE-MANUAL-SMOKE.md) - N/A: no release-cut smoke checklist surface changed.Closes #NNNin the## RelatedsectionImpact
Related
AI Authored PR Metadata (required for Codex/Linear PRs)
Linear Issue
Commit & Branch
Validation Run
pnpm --filter openhuman-app format:check- blocked locally on fork-main baseline drift; see Validation Blocked. Touched files pass targeted Prettier check.pnpm typecheck- passed.pnpm --dir app exec vitest run src/pages/onboarding/__tests__/OnboardingLayout.test.tsx --config test/vitest.config.ts- passed, 7 tests.Validation Blocked
command:pnpm format:checkerror:Local fork baseline (openhuman-app@0.53.43) reports pre-existing Prettier drift in 26 unrelated files, for examplepackage.json,src/pages/Conversations.tsx, andtest/wdio.conf.ts. The two touched onboarding files pass targeted Prettier check.impact:Full local format check cannot be used on this fork baseline, but the patch files are formatted and GitHub CI should evaluate the merge result against current upstream main.Behavior Changes
openhuman.app_state_snapshottimeout while skipping/completing onboarding.Parity Contract
setOnboardingCompletedFlag(true)remains required and still rejects on failure; only the metadata sync failure is swallowed.Duplicate / Superseded PR Handling
#1728,app_state_snapshot, or onboarding skip timeout. Broad open-PR search returned unrelated Add agent task orchestration #1768, feat: add Chinese (简体中文) i18n support #1518, and Fix core-state poll logs and rewards timeout UX #1321.Summary by CodeRabbit
Bug Fixes
Tests