Repository navigation
Description
What happens
- Sign up for a slot and open the edit link (from the "You're in." screen or the confirmation email).
- Press Cancel signup, then Yes, cancel. You land back on the public page and the spot is free again.
- Open the same edit link again.
The page shows the full edit form as if the sign-up were still active: "You're editing this as …", the Name and Notes boxes, and the Save and Cancel signup buttons. Nothing says the sign-up was cancelled.
- Save fails with the raw server text "commitment is not active".
- Cancel signup goes through again and nothing changes.
The link in the confirmation email never changes, so this is the page anyone sees if they come back to it after cancelling.
Why
getOwnCommitment (src/services/commitments.ts) checks the token and that the signup isn't deleted, but not the commitment's status. src/app/s/[slug]/c/[id]/page.tsx renders EditForm for whatever it returns. The returning-participant lookup (getOwnCommitmentsForSignup) already keeps only confirmed and tentative commitments, so the banner on the public page is right. Only the edit page misses the check.
Fix, in outline
- When the commitment is
cancelled, the edit page shows a message instead of the form: the sign-up was cancelled, with a link back to the signup so they can sign up again. Reuse an existing banner or state-message component rather than adding a new one. - Keep this distinct from the "Sorry, this link isn't working" page. The token is valid, and someone who cancelled by mistake should learn what happened.
- In
edit-form.tsx, show plain wording for the "commitment is not active" conflict, for when the sign-up is cancelled in another tab while the form is open.
Done when
- Opening a cancelled sign-up's edit link shows the cancelled message, with no Save or Cancel signup buttons.
- A test covers it.
tests/e2e/edit-token.spec.tsalready cancels a sign-up and can open the link again afterwards. pnpm lint && pnpm typecheck && pnpm knip && pnpm testpass.
Found while capturing screens for #347.
Activity