fix(auth): recover from an unclaimable PR environment on dev signup - #304
Draft
posthog[bot] wants to merge 1 commit into
Draft
posthog[bot] wants to merge 1 commit into
posthog[bot] wants to merge 1 commit into
Conversation
On dev/QA the signup form renders an optional PR Number field. A prNumber whose tenant-<prNumber>-* namespace is missing (404 PR_NAMESPACE_NOT_FOUND) or not READY (409 PR_NAMESPACE_UNAVAILABLE) failed with a fading toast that showed the raw backend string, left submit enabled, and stacked a new toast per retry. Route those two codes to a persistent inline notice on the PR Number field that names the cause (missing vs not ready), disable submit while it stands, and offer "clear the PR number to use a shared dev cluster" as recovery. Editing or clearing the field clears the notice. Reuses the inline-notice pattern from PR #225. Dev/QA only: the field renders only when NEXT_PUBLIC_PR_NUMBER_ENABLED is set. paths: src/app/(auth)/auth/constants/auth-error-codes.ts src/app/(auth)/auth/constants/auth-error-codes.test.ts src/app/(auth)/auth/hooks/use-auth.ts src/app/(auth)/auth/pages/signup-page.tsx Generated-By: PostHog Desktop Task-Id: 35ac829f-6788-4788-ac14-1ff944e9cdbf
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.
Problem
prNumbermakes the backend skip the "claim any READY cluster" path and look only for atenant-<prNumber>-*namespace. When it is missing or not READY, the form showed the raw backend string in a toast, never disabled submit, and stacked a fresh toast on each retry — so testers just hammered Start Free Trial.NEXT_PUBLIC_PR_NUMBER_ENABLEDis set, and PR-number registration runs only in the dev/QA auth-server configs. Production signup is untouched.Changes
Route the two distinct backend failures to a persistent inline notice on the PR Number field, instead of a toast that fades:
PR_NAMESPACE_NOT_FOUNDPR_NAMESPACE_UNAVAILABLEDisable submit while the notice stands (via the existing
isValidgate).Offer recovery: a "Clear the PR number to use a shared dev cluster" action, and clearing/editing the field also clears the notice.
registerOrganizationnow returns the PR-namespace issue instead of toasting it; every other outcome is handled as before.Reuses the inline-notice pattern from fix(auth): show registration-capacity block as a persistent inline notice with recovery #225 (the
Inputerror/errorVariantslot) rather than adding a new banner.Why
Testers hit this repeatedly on dev, each incident costing a full signup attempt plus triage time, with no in-UI hint that leaving the field blank is the workaround.
Testing
getPrNamespaceIssueunit test pins the code → issue mapping (missing vs not-ready, and pass-through for other codes).tsc --noEmitandbiome checkclean on the changed files.Note
A live dev reproduction (a real 404/409 from an unprovisioned PR environment) was not possible in the build sandbox — it needs the SaaS backend with
pr-number-registrationenabled. Reviewers should confirm the notice, disabled submit, and recovery on a dev host withNEXT_PUBLIC_PR_NUMBER_ENABLED=true.Agent context
flamingo-stack/openframe-saas-tenant, but that is a GitOps/config repo —signup-page.tsxand fix(auth): show registration-capacity block as a persistent inline notice with recovery #225 live here, so the fix lands here.Created with PostHog Desktop from this inbox report.