Skip to content

fix: add cooldown for raised hand changes - #220

Merged
TheCodeHeist-Coder merged 1 commit into
TheCodeHeist-Coder:mainfrom
dasarisandeepreddy8658:fix/raise-hand-cooldown
Oct 26, 2026
Merged

TheCodeHeist-Coder merged 1 commit into
TheCodeHeist-Coder:mainfrom
dasarisandeepreddy8658:fix/raise-hand-cooldown

Conversation

@dasarisandeepreddy8658

Copy link
Copy Markdown
Contributor

What does this PR do?

  • Adds a 1-second server-side cooldown for raised-hand changes per participant and session.
  • Returns HTTP 429 when a participant tries to change their raised-hand state too quickly.
  • Disables the frontend hand button during the cooldown and displays a waiting message.
  • Adds backend tests for rapid repeated requests and requests after the cooldown expires.

Related issue

Closes #206

Type of change

  • Bug fix
  • New feature
  • Documentation
  • Refactoring
  • Performance
  • Tests
  • Build / CI / deployment

Which services does this touch?

  • apps/frontend
  • apps/http-server
  • apps/ws-server
  • apps/streaming
  • apps/genAI
  • packages/db (schema or Prisma changes)
  • Docker / CI

How did you test this?

  • Ran pnpm.cmd --filter ./apps/frontend test — 72 tests passed across 9 test files.
  • Ran pnpm.cmd --filter ./apps/streaming test — 33 tests passed across 2 test files.
  • Added backend tests to verify that rapid repeated hand changes return HTTP 429 and that requests are accepted again after the cooldown expires.

Implementation note: The cooldown is stored in memory and is tracked separately by each streaming server instance.

Checklist

  • I ran pnpm run lint
  • I ran pnpm run check-types
  • I ran pnpm run build
  • The app still starts with docker-compose up
  • I updated documentation if this changes behaviour or setup
  • I did not commit any .env file, API key or other secret

First pull request here? CONTRIBUTING.md walks through the
whole process, and a checkbox left unticked is not a problem — say so and we
will help.

@TheCodeHeist-Coder
TheCodeHeist-Coder merged commit 4e15630 into TheCodeHeist-Coder:main Oct 26, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nothing stops a player spamming the raise-hand button

2 participants