Skip to content

Submit form: carry on after the site is updated under it - #612

Merged
ericzakariasson merged 1 commit into
mainfrom
submit-form-survives-deploy
Dec 1, 2026
Merged

ericzakariasson merged 1 commit into
mainfrom
submit-form-survives-deploy

Conversation

@ericzakariasson

Copy link
Copy Markdown
Member

Summary

Every deploy gives the site's server actions new names. A submit form that was open before the deploy still posts the old names, and the server answers that it does not know them.

During a deploy today, two people had submissions fail this way. One tried nine times over eight minutes before reloading the page. The form showed "Failed to parse repository" or "Failed to publish plugin", trying again failed the same way, and reloading emptied the form.

The form now recognises that answer. It saves what was entered, reloads the page and takes the draft back.

What failed After the reload
Scanning a repository The address is back and the scan runs again by itself. It only reads the repository.
Publishing Everything is back as it was, with a note to publish again. The form does not publish by itself.

Two cases where it does not reload:

  • The page is still out of date right after a reload. The message says to reload the page, and the draft is kept for that reload.
  • The browser will not store the draft. The message says that what was entered would be lost, so it can be copied first.

Things to know

  • It starts helping one deploy later. The page that recovers is the old one, so it has to contain this code already. Forms that are open during the deploy that ships this change still fail as before.
  • The draft stays in the browser tab for five minutes at most and is read once.
  • The draft's format carries a version number, because the page that saves it and the page that reads it are different versions of the site. A draft the new page does not understand is dropped, and the form starts empty.
  • Not covered: the logo upload inside the form, and the edit form. They fail the same way on an old page.
  • The other fix is in the hosting settings. Skew Protection in the Vercel project is meant to keep an old tab talking to the deployment it came from. It needs no code and would cover every form. This change is still useful with it, since that protection only lasts for a set time.

Testing

  • bunx biome ci . and bun run typecheck in apps/cursor pass.
  • Run locally on a temporary page that shows the form without the sign-in gate. The page was made to post action names the server does not have, which the server answers the same way as after a deploy (409).
    • A failed scan: the page reloads by itself, the address is back and the scan runs again.
    • A failed publish, for a manual plugin and for a scanned one: the page reloads by itself and every field and component is back, with the note. Nothing is published by itself.
    • A second failure right after: no second reload, one post only, and the message. Reloading by hand brings the draft back.
    • The browser refusing to store the draft: no reload, and the message that says it would be lost.
    • Drafts in a newer format, older than five minutes, not readable, with an unknown kind of component or with a field missing: the form starts empty.
  • Preview build: it builds, the submit page's script carries the new code, and an action name the preview does not have gets the same 409 answer.
  • Not tested: a real deploy with a signed-in member. Nobody is signed in locally, so the scan that runs again after the reload ends in a sign-in error there.

A deploy gives every server action a new name. A submit form that was
open before the deploy still posts the old names, and the server
answers that it does not know them. The form showed "Failed to parse
repository" or "Failed to publish plugin", and trying again failed the
same way until the page was reloaded, which emptied the form.

The form now recognises that answer. It saves what was entered, reloads
the page and takes the draft back:

- A scan that failed is run again by itself, since it only reads the
  repository.
- After a failed publish, everything is back as it was and a note says
  to publish again. The form does not publish by itself.
- If the page is still out of date right after a reload, it does not
  reload again. It says to reload the page, and the draft is kept for
  that reload.
- If the browser will not store the draft, the page is not reloaded and
  the message says what was entered would be lost.

The draft lives in the browser tab for five minutes at most and is
read once. Its format carries a version, because the page that saves it
and the page that reads it are different versions of the site.

Co-authored-by: Cursor <cursoragent@cursor.com>
@ericzakariasson
ericzakariasson merged commit 3a813c6 into main Dec 1, 2026
1 check passed
@ericzakariasson
ericzakariasson deleted the submit-form-survives-deploy branch December 1, 2026 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant