Skip to content

fix(server): clamp like slide indexes - #4

Merged
carlok merged 1 commit into
mainfrom
agent/contribution-2026-06-16
Jun 16, 2026
Merged

carlok merged 1 commit into
mainfrom
agent/contribution-2026-06-16

Conversation

@carlok

@carlok carlok commented Jun 16, 2026

Copy link
Copy Markdown
Owner

What and why

Audience like messages accepted any numeric slide index while projector slide navigation already clamped indexes to the known deck range. A malformed or stale audience client could therefore create like counters for negative or out-of-range slide IDs and send impossible like_update payloads to the projector. This change reuses one server-side clamp helper for slide navigation, presentation state, and like messages so all slide-indexed WebSocket state stays within the active deck range.

How to verify

  1. Run ./run_tests.sh from the repository root.
  2. Confirm all four suites pass.
  3. In particular, confirm the server WebSocket test suite includes the regression case for negative and too-large like slide indexes.

Notes

Validation before the change: ./run_tests.sh passed with converter Python 124 tests, converter JS 29 tests, server Python 49 tests, and server JS 26 tests. Validation after the change: ./run_tests.sh passed with converter Python 124 tests, converter JS 29 tests, server Python 50 tests, and server JS 26 tests. No pre-existing failing checks were observed. The containerized npm installs reported pre-existing audit warnings; dependency updates are intentionally out of scope for this bug fix.

@carlok
carlok merged commit 863b768 into main Jun 16, 2026
8 checks passed
@carlok
carlok deleted the agent/contribution-2026-06-16 branch October 14, 2026 11:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant