fix(onboarding): resolve overlay race condition between RPC and Redux state#284
Conversation
… state OnboardingOverlay could reappear for already-onboarded users when the core config RPC call failed (sidecar not ready, timeout). The catch block hardcoded `false`, ignoring the persisted Redux `isOnboardedByUser` flag. Now reads `selectIsOnboarded` as a fallback in the catch block and combines both flags in shouldShow — either being true prevents the overlay. Also fixes DEV_FORCE_ONBOARDING which was a no-op (identical ternary branches). Closes #197
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThis PR fixes a race condition in Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
… state (tinyhumansai#284) OnboardingOverlay could reappear for already-onboarded users when the core config RPC call failed (sidecar not ready, timeout). The catch block hardcoded `false`, ignoring the persisted Redux `isOnboardedByUser` flag. Now reads `selectIsOnboarded` as a fallback in the catch block and combines both flags in shouldShow — either being true prevents the overlay. Also fixes DEV_FORCE_ONBOARDING which was a no-op (identical ternary branches). Closes tinyhumansai#197
Summary
Fixes the OnboardingOverlay race condition where the core config RPC call (
getOnboardingCompleted()) could fail (sidecar not ready, timeout, permission error), causing the overlay to reappear for already-onboarded users.Root cause
The
catchblock in the RPC effect hardcodedsetOnboardingCompleted(false), ignoring the Redux-persistedisOnboardedByUserflag that may already betrue.Changes
OnboardingOverlay.tsx: Import and readselectIsOnboardedfrom Redux. Use it as fallback in the RPC error catch block. Combine both flags inshouldShowso either beingtrueprevents the overlay. Also fixesDEV_FORCE_ONBOARDINGwhich was a no-op (identical ternary branches).OnboardingOverlay.test.tsx: Add 3 new test cases covering RPC failure + Redux onboarded, RPC false + Redux onboarded, and RPC failure + Redux not onboarded (regression guard).Behavioral impact
truefalse, Reduxfalsefalse, ReduxtruetruefalseDEV_FORCE_ONBOARDINGsetTest plan
yarn typecheck— passyarn lint— pass (0 errors)yarn format:check— passyarn build— passCloses #197
Summary by CodeRabbit
Bug Fixes
Tests