Commit Graph
2 Commits
Author SHA1 Message Date
PaddyandClaude Opus 5.5 adf723419d Match a submission's client token only within its event
Test and deploy / test-and-deploy (pull_request) Successful in 27s
The token is per form visit, and one visit can move on to another
concert's form in the same tab. With a global match, the second event's
submission was answered with the first event's id and its feedback was
silently dropped. The lookup now joins on the event slug, and the unique
index in 003 is (event_id, client_token) instead of client_token alone.

003 is edited in place: it has not been applied anywhere yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 18:27:27 +01:00
PaddyandClaude Opus 5.5 f3f4ca2c9f Answer a retried feedback submission with the one already saved
Test and deploy / test-and-deploy (pull_request) Successful in 46s
When a submission saved but its response never reached the phone, the
form showed an error, the visitor tapped "Feedback absenden" again, and a
second identical row was stored (seen twice in production: 82/83, 87/88).

The form now sends a clientToken, one UUID per visit, on every attempt.
A token that is already stored returns the original submissionId and
saves nothing; the lookup runs before the eligibility check, so a retry
still succeeds if the feedback window closed in between. Two concurrent
retries are settled by a UNIQUE index on submissions.client_token: the
loser gets ER_DUP_ENTRY, rolls back and returns the winner's id. A missing
or non-UUID token behaves as before, so cached copies of the old form
still submit.

Migration 003 must be applied before this is deployed - the INSERT now
writes client_token.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 17:48:33 +01:00