feat: Add protocol spec, rate limiting, vitest framework, and documentation

## Added
- **WebSocket Protocol Specification** (docs/PROTOCOL.md) - Complete reference
  for all 20+ events with payload schemas, rate limits, and edge cases
- **LEAVE_ROOM Rate Limiting** - 10 requests/socket/minute to prevent abuse
- **Vitest Testing Framework** - Modern test setup with coverage reporting
- **Host Control Mode Documentation** - Consolidated EN documentation
  (docs/host-control-mode.md) with references to internal implementation

## Changed
- **Graceful Shutdown** - Socket.IO clients properly disconnected during
  server shutdown (server/index.js)
- **CI Workflow** - Added test step with continue-on-error for gradual rollout
- **README** - Added protocol documentation link
- **CHANGELOG** - Updated with all new features and improvements

## Moved
- Internal documentation moved to docs/internal/ for better organization
- Host Control Mode docs consolidated from 4 files to 1 comprehensive guide

## Technical Details
- Protocol spec: 495 lines, covers all events from shared/constants.js
- Rate limiter: Follows existing pattern (checkAuthRate, checkEventRate)
- Vitest: 6 tests for rate limiter, all passing
- Documentation: Host Control Mode doc includes edge cases, testing checklist,
  architecture decisions
This commit is contained in:
Skrockle
2026-07-01 23:27:30 +02:00
parent 1f5196e1e6
commit 463f871958
15 changed files with 2687 additions and 13 deletions
+8
View File
@@ -18,9 +18,17 @@ All notable changes to the KoalaSync browser extension and relay server.
- **Backward-compatible Host Control rollout** — The extension only shows Host Control when the connected relay supports it, so users on older self-hosted servers do not see controls that cannot work yet.
- **Extension: Clear host and guest states** — The popup shows the current control mode, host status, peer roles, and localized guest guidance so participants understand when playback is controlled by the host.
- **Website: FAQ clarification for streaming access** — The landing page and FAQ structured data now state clearly that KoalaSync does not stream, host, share, or bypass access to video content. Every participant watches locally and needs their own access to services such as Netflix.
- **Documentation: WebSocket Protocol Specification** — Complete reference for all protocol events, payload schemas, rate limits, and edge cases in PROTOCOL.md.
- **Server: Graceful Shutdown** — Socket.IO clients are now properly disconnected during server shutdown.
- **Server: LEAVE_ROOM Rate Limiting** — Prevents abuse with 10 requests per socket per minute limit.
- **Testing: Vitest Framework** — Modern testing setup with coverage reporting for server and shared modules.
### Changed
- **Playback sync now follows the room's control setting** — When Host Control is enabled, only the host can drive room-wide playback changes; guests can still watch in sync without accidentally changing playback for everyone.
- **Architecture: Modularized background.js** — Refactored 2410-line file into 11 focused modules for better maintainability.
- **Documentation: Consolidated Host Control Mode** — Unified documentation in host-control-mode.md with references to internal implementation details.
- **README: Added protocol documentation** — Updated documentation links to include PROTOCOL.md reference.
- **ARCHITECTURE: Added protocol reference** — Updated architecture documentation with link to PROTOCOL.md.
---