test(server): input-authority-during-skip-check proves absences with a fixed 80 ms tick, which a late leak would pass

Open
#9,342 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
50/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Active
Tech stack
javascript
Domain
backend, testing

Research direction

Start with packages/server/tests/input-authority-during-skip-check.test.js and find each absence assertion that follows the fixed tick() (80 ms), such as the empty-slice and unchanged callCount checks. Then look at where _handleMessage finishes handling a frame in the server source, to decide whether a handled-message counter or hook can be awaited instead. Done means every absence check waits on that completion signal rather than wall time, and a mutant that delays the leak past 80 ms makes the relevant case fail.

Written by the indexing model from the issue text.

Description

testing

Context

Found while fixing #9339.

Description

packages/server/tests/input-authority-during-skip-check.test.js proves several things did NOT happen by waiting a fixed tick() (80 ms) and then asserting an empty slice or an unchanged callCount:

  • a stripped bound client receives nothing while gated;
  • non-auth frames from a stripped client are refused;
  • input to a session outside the client's scope is not dispatched.

A fixed wait is the false-green direction for an absence assertion. If a regression leaked a frame or dispatched input after the tick, which is more likely under load since _handleMessage is async, the test would still pass. The risk in practice is low: the broadcast-drop paths are synchronous. But this is a security-relevant file (input authority while stripped or gated), and these assertions are its point.

There is no shared quiescence helper in packages/server/tests. A sentinel round-trip does not fit the stripped-client cases, because a stripped client is deliberately sent nothing, so there is no reply to wait on.

Acceptance Criteria

  • Each absence assertion in the file is bounded by something that proves the server finished handling the frame in question, not by wall time. For example, a server-side handled-message hook or counter the test can await, or a sentinel round-trip where a reply exists, such as an input_ack for the re-authed client.
  • A mutant that delays the leak or dispatch past the old 80 ms tick turns the relevant case red.
Dominant language
JavaScript
Stars
7
Forks
1
Avg merge
2h 3m
Merged PRs (30d)
333

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from blamechris/chroxy

All issues in blamechris/chroxy

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.