Store answers atomically and limit word cloud input
CI / Deploy / test (push) Successful in 51s
CI / Deploy / deploy (push) Skipped

- Run the checks and the insert of VoteService::submit() in one transaction
  with the slide row locked, so double clicks or retries cannot store a vote
  twice (also covers the Q&A upvote budget and word cloud duplicates).
- Limit word cloud terms per request and per participant, and throttle
  answers per IP and minute (THROTTLE_VOTES_PER_MINUTE, 429 with message).
- Treat array values in text fields as empty instead of storing "Array".
- Move the throttle helper to AppController for reuse.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
gnilebeinandClaude Opus 5.5 committed 2026-11-08 22:01:19 +01:00
1 parent 8b0e82d806
commit 9c532d164f
11 files changed
+224 -50

No files matched your search

+2
View File
@@ -34,6 +34,8 @@ SHOW_ADMIN_LINK_AFTER_CREATE=false
# Max. polls / recovery mails per IP and hour (0 = unlimited)
THROTTLE_CREATE_PER_HOUR=10
THROTTLE_RECOVER_PER_HOUR=5
# Max. answers per IP and minute (0 = unlimited). Keep it high: a whole audience may share one Wi-Fi/IP.
THROTTLE_VOTES_PER_MINUTE=600
# How often presenter and participant pages poll for updates (ms)
POLL_INTERVAL_MS=2000
# Embedded slides (/e/{key}/{slide}, e.g. Canva): heartbeat interval and timeout until pause (s)