fix(onboarding): stop pinning new users to /app/new - #2890
Draft
posthog-eu[bot] wants to merge 2 commits into
Draft
fix(onboarding): stop pinning new users to /app/new#2890posthog-eu[bot] wants to merge 2 commits into
posthog-eu[bot] wants to merge 2 commits into
Conversation
The resume guard added for post-cutoff single-org/single-app users force-redirected them back to /app/new on every navigation, and the only escape hatch lived in module-level state that a page reload wiped. - Persist the exploration grant in sessionStorage keyed by user id so it survives a reload (with an in-memory fallback for restricted contexts). - Grant exploration when the user deliberately leaves /app/new (Back, breadcrumb, sidebar tab) so the guard stops bouncing them back. - Refresh app/new.vue's app count on org change without toggling the full-page loader, which used to remount the flow and wipe typed input. - Give the org switcher a compact name-only path for creating an additional org instead of the full new-user wizard. Generated-By: PostHog Code Task-Id: cdd1ecee-fed7-40e9-832b-0173e86b56fb
Contributor
Merging this PR will not alter performance
Comparing Footnotes
|
The compact create-org input reused the full-flow input's DOM id (`onboarding-org-name-input`). Though the two are mutually exclusive at runtime via v-if/v-else, the duplicate id tripped SonarCloud's reliability gate. Rename the compact input's id/label to a distinct `onboarding-org-name-compact`. Generated-By: PostHog Code Task-Id: cdd1ecee-fed7-40e9-832b-0173e86b56fb
|
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.



Summary
New signups with exactly one org and one app were pinned to
/app/new: the resume guard re-fired on every navigation, and its only escape hatch lived in module-level state that a reload wiped — so Back, the breadcrumb, and sidebar tabs all bounced straight back.Problem
allowOnboardingDashboardExploration) kept state in module-level variables, so a full reload wiped it and re-armed the trap.app/new.vuere-raninit()on everycurrentOrganizationchange, re-showing the full-page loader and remountingAppOnboardingFlow— discarding whatever the user had typed.Changes
sessionStoragekeyed by user id (in-memory fallback for SSR/privacy mode), so it survives a reload instead of re-arming./app/new(from.path === '/app/new'), carrying the pendingresumeapp id, so Back / breadcrumb / sidebar tabs work.app/new.vuewatches the org gid and refreshes the app count without togglingisLoading, keepingAppOnboardingFlowmounted and preserving form input.Test plan
bun run test:unit— added/updated coverage:tests/onboarding-redirect.unit.test.ts— grant is per-user and survives a module reload (sessionStorage); graceful in-memory fallback when storage is unavailable.tests/auth-sso-provisioning.unit.test.ts— driving the real navigation guard: an eligible user leaving/app/newis not bounced back, and stays put on subsequent navigations.bun run typecheck:frontendandeslint/oxlinton the changed files pass.Manual/visual verification of the fixed states (loader flash, remount, compact flow) requires a deployed environment with an authenticated post-cutoff new-user session; the affected behavior is documented in the linked report and the trap's break is covered by the guard-level test above.
Screenshots
None — behavior change; see test plan.
Checklist
bun run lint:backend && bun run lint.Created with PostHog Desktop from this inbox report.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.