{"record":{"id":"cc9ff518a88fae0a","repo":"BloopAI/vibe-kanban","slug":"missing-required-fields","errorCode":null,"errorMessage":"Missing required fields","messagePattern":"Missing required fields","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/web-core/src/shared/dialogs/command-bar/CreateWorkspaceFromPrDialog.tsx","lineNumber":140,"sourceCode":"          break;\n        default:\n          prsErrorMessage =\n            prsResult.message ||\n            t('createWorkspaceFromPr.errors.failedToLoadPrs');\n      }\n    } else if (prsError) {\n      prsErrorMessage = t('createWorkspaceFromPr.errors.failedToLoadPrs');\n    }\n\n    const createMutation = useMutation({\n      mutationFn: async () => {\n        if (\n          !selectedRepoId ||\n          !selectedPrNumber ||\n          !selectedRemote ||\n          !selectedPr\n        ) {\n          throw new Error('Missing required fields');\n        }\n        const result = await workspacesApi.createFromPr({\n          repo_id: selectedRepoId,\n          pr_number: selectedPrNumber as unknown as bigint,\n          pr_title: selectedPr.title,\n          pr_url: selectedPr.url,\n          head_branch: selectedPr.head_branch,\n          base_branch: selectedPr.base_branch,\n          run_setup: runSetup,\n          remote_name: selectedRemote,\n        });\n        if (!result.success) {\n          switch (result.error?.type) {\n            case 'branch_fetch_failed':\n              throw new Error(result.error.message);\n            case 'auth_failed':\n              throw new Error(result.error.message);\n            case 'cli_not_installed':","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/BloopAI/vibe-kanban/blob/4deb7eca8f381f7cbc1f9d15515a9ab8f8009053/packages/web-core/src/shared/dialogs/command-bar/CreateWorkspaceFromPrDialog.tsx#L122-L158","documentation":"CreateWorkspaceFromPrDialog validates that a repo, PR number, remote, and PR record were all selected before calling workspacesApi.createFromPr. If any is missing it throws 'Missing required fields'. The SOURCE block contains the throw site (validation guard); RAISED IN points at the dialog component itself.","triggerScenarios":"Submitting the dialog while state is incomplete: async PR/repo loading hasn't finished, remote list empty so selectedRemote stays null, or the user bypasses the disabled button via keyboard/Enter before selections resolve.","commonSituations":"Slow GitHub/GitLab API causing selectedPr to remain null while the button is clickable; a repo with no remotes so selectedRemote is never set; race between fetch resolution and form submit.","solutions":["Disable the submit button until all four fields (selectedRepoId, selectedPrNumber, selectedRemote, selectedPr) are non-null","Verify the PR/repo fetches completed and set state before allowing submission","Check that the chosen repo actually has matching remotes; surface a message when none exist","If it persists, confirm the API responses actually populate the selection state (network tab)"],"exampleFix":"// before\ndisabled={creating}\n// after\ndisabled={creating || !selectedRepoId || !selectedPrNumber || !selectedRemote || !selectedPr}","handlingStrategy":"validation","validationCode":"const canSubmit = !!selectedRepoId && !!selectedPrNumber && !!selectedRemote && !!selectedPr;\nif (!canSubmit) return; // or disable the button with !canSubmit","typeGuard":"function isSelectionComplete(s: { repoId?: string|null; prNumber?: number|null; remote?: string|null; pr?: { title: string }|null }): s is { repoId: string; prNumber: number; remote: string; pr: { title: string } } { return !!s.repoId && !!s.prNumber && !!s.remote && !!s.pr; }","tryCatchPattern":"try {\n  await createWorkspaceFromPr(fields);\n} catch (e) {\n  if (e.message === 'Missing required fields') notify.warn('Please wait for the PR and repo to finish loading.');\n}","preventionTips":["Disable submit until every selection resolves non-null","Show per-field loading indicators so users don't submit mid-fetch","Reset selections when the repo changes so stale prNumber/pr never pair with a new repo"],"tags":["validation","ui-state","form"],"backgroundTag":"missing-required-field","analyzedSha":"4deb7eca8f381f7cbc1f9d15515a9ab8f8009053","analyzedAt":"2026-08-29T09:24:13.446Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}