Match a submission's client token only within its event
Test and deploy / test-and-deploy (pull_request) Successful in 27s
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>
This commit is contained in:
4 files changed
+38
-13
No files matched your search
@@ -7,8 +7,11 @@
|
||||
-- sees an error and taps "absenden" again; the API now finds the stored token
|
||||
-- and answers with the original submission instead of saving a copy.
|
||||
--
|
||||
-- Unique per event, not globally: one visit can switch to another concert's
|
||||
-- form in the same tab, and that event's submission must still save.
|
||||
--
|
||||
-- NULL for every row written before this migration and for any client that
|
||||
-- sends no token; a UNIQUE index allows any number of NULLs.
|
||||
ALTER TABLE submissions
|
||||
ADD COLUMN client_token CHAR(36) NULL AFTER ip_hash,
|
||||
ADD UNIQUE KEY uq_sub_client_token (client_token);
|
||||
ADD UNIQUE KEY uq_sub_event_client_token (event_id, client_token);
|
||||
Reference in new issue
Block a user