Skip to content

Document.content has two competing writers: Yjs persistence vs REST autosave #47

Description

@Alimedhat000

Problem

The Hocuspocus database extension overwrites Document.content from Yjs state on every debounced sync (server/src/lib/dbPersistence.ts:65-68), while REST PUT /document/:id writes content directly (document.controller.ts:231-234) — the client autosave path uses it. Last-writer-wins silently discards edits.

Related: #35 (dead autosave hook).

Fix

Pick one source of truth: either derive content from Yjs exclusively (drop REST content writes) or make REST authoritative and stop syncing content from Yjs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpriority/mediumMedium priority

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions