Skip to content

Commit 92f270f

Browse files
committed
fix(onboarding): Drop an unresolved repo from the wizard snapshot
An optimistic repository (empty id, see useScmRepoSelection) can be in wizard state at completion when the user creates the project before the repo resolution lands. Persisting it strands the restored session's platform detection in a permanent pending state, since the query can only fetch with a real id. Snapshot the session without it; the committed platform and features still restore.
1 parent 8f74904 commit 92f270f

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

static/app/views/projectInstall/scmCreateProject.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,12 @@ function ScmCreateProjectWizard({initialState}: {initialState: WizardState}) {
197197
({project, projectDetailsForm: submittedForm}: ScmProjectDetailsCompletion) => {
198198
writeStorageValue(WIZARD_STORAGE_KEY, {
199199
...wizardState,
200+
// An optimistic repo (empty id, see useScmRepoSelection) can never
201+
// fetch detection; restoring one would strand the platform section in
202+
// a permanent spinner, so it is not worth persisting.
203+
selectedRepository: wizardState.selectedRepository?.id
204+
? wizardState.selectedRepository
205+
: undefined,
200206
createdProjectId: project.id,
201207
createdProjectSlug: project.slug,
202208
projectDetailsForm: submittedForm,

0 commit comments

Comments
 (0)