fix: Onboarding persistence and update interval#1251
Merged
charlesvien merged 3 commits intoPostHog:mainfrom Mar 16, 2026
Merged
Conversation
added 3 commits
March 15, 2026 19:14
Remove hasCompletedOnboarding reset from logout(). Onboarding completion is a user-level fact that should persist across logouts — a user who logs out and back in shouldn't redo the tutorial. This was the root cause of users being forced through onboarding after auto-updates: token refresh failure triggers logout, which wiped the onboarding flag. Closes PostHog#1230 Partially addresses PostHog#1228
Add a button in Settings > Advanced that resets the onboarding state, allowing developers to re-test the onboarding flow without clearing all application data. Related to PostHog#1229 (skip button addressed in PostHog#1240)
Change CHECK_INTERVAL_MS from 1 hour to 24 hours. The previous frequency was too aggressive and, combined with the onboarding reset bug, made the app feel unusable — users were forced through auth + tutorial on every update cycle. Closes PostHog#1228
jonathanlab
approved these changes
Mar 16, 2026
Contributor
jonathanlab
left a comment
There was a problem hiding this comment.
LGTM! We should probably split this onboarding logic up into the tutorial part and a part that is responsible for actually configuring your organization + project settings (e.g. signals/github integration), since that is not a user level concern.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1228
Related: #1229 (skip button addressed in #1240)
Summary
Fixes the root cause of users(or devs) being forced through re-authentication and the onboarding tutorial
after every auto-update.
The problem
logout()inauthStore.tsunconditionally resethasCompletedOnboarding: false. When the apprestarts after an auto-update and token refresh fails (transient network error, brief API
outage), it triggers
logout()— which wiped the onboarding flag. The user then sees the fulltutorial again, even though they completed it. With auto-update checks running every
hour, this happened frequently.
What changed
1. Preserve onboarding state on logout (
authStore.ts)Removed
hasCompletedOnboarding: falsefrom thelogout()method. Onboarding completion is auser-level fact — logging out and back in shouldn't force the tutorial again:
set({ oauthAccessToken: null, isAuthenticated: false, hasCodeAccess: null, - hasCompletedOnboarding: false, selectedPlan: null, // ... });2. Add "Reset onboarding" button in Advanced Settings (
AdvancedSettings.tsx)Replaces the implicit logout-based reset with an explicit developer action. Settings → Advanced
→ "Reset onboarding" sets the flag to false, so the tutorial runs on next restart:
3. Reduce auto-update check interval to 24 hours (
updates/service.ts)Updated the corresponding test assertions to match.
Changes
authStore.tshasCompletedOnboarding: falsefromlogout()AdvancedSettings.tsxupdates/service.tsCHECK_INTERVAL_MSfrom 1h → 24hupdates/service.test.tsTest plan
pnpm --filter code typecheckpassespnpm --filter code testpasses