Bounty: $45 (LT)
Area: market/ws/server.go
Current state: The WebSocket hub manages client registration, unregister, ping/pong deadlines, and broadcast fan-out, but there is no focused test coverage for lifecycle behavior. The broadcast path also removes slow clients from Hub.clients while holding RLock, so the expected cleanup behavior should be covered before further changes.
What is needed: Add Go tests for the WebSocket hub lifecycle and tighten the slow-client cleanup path if the tests expose the locking issue.
Acceptance criteria:
- Cover client registration and unregister removing clients exactly once.
- Cover broadcast delivery to active clients.
- Cover slow/full client send buffers being removed without mutating
Hub.clients under a read lock.
- Cover ping/write loop shutdown or close behavior where practical without long sleeps.
- Keep the change scoped to
market/ws lifecycle logic and tests.
Required validation:
- Run
go test ./market/ws or the closest package-level Go test command available in this repo.
- Run
python3 build.py.
- Include the generated
diagnostic/build-*.logd artifact from diagnostic/; include the matching diagnostic/build-*.json if present.
- Use
.github/pull_request_template.md for the submission.
Bounty: $45 (LT)
Area:
market/ws/server.goCurrent state: The WebSocket hub manages client registration, unregister, ping/pong deadlines, and broadcast fan-out, but there is no focused test coverage for lifecycle behavior. The broadcast path also removes slow clients from
Hub.clientswhile holdingRLock, so the expected cleanup behavior should be covered before further changes.What is needed: Add Go tests for the WebSocket hub lifecycle and tighten the slow-client cleanup path if the tests expose the locking issue.
Acceptance criteria:
Hub.clientsunder a read lock.market/wslifecycle logic and tests.Required validation:
go test ./market/wsor the closest package-level Go test command available in this repo.python3 build.py.diagnostic/build-*.logdartifact fromdiagnostic/; include the matchingdiagnostic/build-*.jsonif present..github/pull_request_template.mdfor the submission.