Switch the editor to live collaboration #36
Labels
No Label
area:auth
area:docs
area:export
area:ops
area:storage
area:supply-chain
auth
backend
blocked
collab
deployment
docs
effort:L
effort:M
effort:S
frontend
plugins
qa
vs-nfd
vs-nfd:blocker
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: stwaidele/dorfteich#36
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
The editor swaps its local-only Y.Doc for the Hocuspocus provider — the moment Dorfteich becomes collaborative.
Scope
Replace REST persistence in the editor hook (#25) with
@hocuspocus/provider: fetch collab token, connect, handle token refresh on reconnect, connection state UI (connected / reconnecting / offline banner), read-only mode forrotokens (editor not editable, presence visible). Remove the debounced-save indicator in favor of sync state.Acceptance criteria
rousers see live changes but cannot type; UI communicates whyTechnical notes
Dependencies
Depends on #25, #35.
Size: ~1.5 days
Conventions: English code/comments, clear human-readable code, no hard-coded UI strings (ADR 0012, add
deanden), permission checks only via the shared guard (docs/architecture/permissions.md). Read the referenced ADRs before starting.Verified on Test and Int (commit
7d04c0b, pipeline green — all CI + CD jobs incl. the new collab e2e pack and Int promotion).Live on Test:
PUT /pages/:id/statenow returns 410rest_state_write_retired(logged in as fixture-user → created a page → PUT → 410 with the collab hint). Combined with #35's verified live collab persistence through the proxy, the editor's write path is fully cut over.The editor is now collaborative (ADR 0003, realtime-collaboration.md):
useCollabProviderbinds the page'sY.Docto aHocuspocusProvider. The document loads and persists through the collab server (#35) — no REST autosave, and no REST seed (a REST seed would fork the doc lineage and duplicate content). The collab token is fetched lazily on every (re)connect via an async token function, so an expired token is replaced transparently and a permission change takes effect on the next reconnect.navigator.onLine.rotokens make the editor non-editable with a reason; the oversize-document stateless error (#35) surfaces a banner. de + en strings added.PUT /pages/:id/stateretired → 410 (the box deferred here from #35); collab is the sole writer, read paths remain.Tests / CI: the e2e static server and vite dev now proxy the
/collabWebSocket (mirroring Caddy), and the auth-e2e CI job starts the collab server and runs a newcollab.spec.ts. It covers the two reachable headline criteria and was validated locally against a full stack (api + collab + built web):context.setOffline, indicator flips to offline, edit persists, reconnect re-fetches a token and converges).Two acceptance boxes intentionally deferred, both to #53 (real permissions): the read-only live assertion (
test.fixme) and, with it, the distinct token-expiry-mid-session scenario beyond reconnect. Under the interim access model seeing and modifying coincide, so no user is ever issued arotoken yet — theroUI is implemented but only becomes reachable when read-only grants exist (#53). Token refresh on reconnect (which is what covers expiry) is exercised by the offline/reconnect test.