Repository navigation
OBJ-81 — WebSocket endpoint + Y.js doc registry - #27
Merged
objectgyan merged 2 commits intoMay 17, 2026
Merged
Conversation
OBJ-81 M5.1 — WebSocket endpoint + Y.js doc registry
Milestone: M5 — Real-time collab · Wave: 2 SummaryExpose Acceptance
Validation
Branch / PRBranch from |
objectgyan
added a commit
that referenced
this pull request
May 17, 2026
Adds /ws/docs/{id} WebSocket endpoint speaking the y-websocket sync + awareness
protocol. Infrastructure layer gains YDocRegistry (singleton ConcurrentDictionary
keyed by document id), YDocSession (accumulated state + connection set), and
YjsWebSocketHandler (varint framing, sync step1/2, update relay, awareness relay).
Sessions tear down 5 s after the last client disconnects; reconnects cancel the
timer. Validated via a Node.js two-client test: update relay latency 11 ms,
awareness relay confirmed, session gone within 10 s of disconnect.
objectgyan
force-pushed
the
objectgyan/obj-81-m51-websocket-endpoint-yjs-doc-registry
branch
from
May 17, 2026 14:25
0e38c63 to
9b18d10
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Linear
Closes OBJ-81
Summary
Adds the
/ws/docs/{id}WebSocket endpoint that speaks the y-websocket sync + awareness protocol. BecauseYcsis not available on NuGet, a minimal protocol-level relay is implemented (~250 lines): varint-prefixed message framing, sync step1/step2/update handling, awareness broadcast. The server holds oneYDocSessionper document in an in-memoryYDocRegistry; idle sessions tear down 5 seconds after the last client disconnects (reconnects cancel the timer).API / data changes
GET /ws/docs/{id:guid}— WebSocket upgrade. Accepts y-websocket sync + awareness frames; relays updates to all other connected sockets.GET /api/collab/sessions/{id:guid}/status— returns{ active: bool }for validation/test use.Plan: plans/projects/document-builder/plan.md (§ OBJ-81)
Contract: plans/projects/document-builder/tickets/api-contracts/OBJ-81-websocket-yjs.md
Validation script: scripts/validate-obj-81.ps1 — exit 0
Outcome report: plans/projects/document-builder/tickets/validation-reports/OBJ-81-outcome.md — VERDICT: PASS
For QA
ws://host/ws/docs/{any-valid-guid}.[0x00, 0x02, 0x05, 0x01, 0x02, 0x03, 0x04, 0x05](sync update).[0x01, 0xCA, 0xFE](awareness); B should receive it.GET /api/collab/sessions/{id}/statusshould return{ "active": false }.Checklist