Page data model and CRUD API with REST-persisted Yjs state #23
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#23
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
Pages carry a Yjs document from day one (ADR 0003) so M3 can switch transport without data migration — but in M2 the state is saved via REST.
Scope
Prisma models
pages,page_updates,page_content_cacheper data-model.md. Endpoints:POST /ponds/:id/pages(title → empty Yjs doc state),GET /pages/:id(meta + base64 state),PUT /pages/:id/state(client-encoded Yjs state, size-limited),PATCH /pages/:id(title/slug),DELETE(soft). On state save, derive and storeplain_text/markdown/html/outlineinpage_content_cacheusing the shared schema (#24) — implement the derivation inpackages/sharedso the collab server reuses it in M3.Acceptance criteria
Technical notes
Dependencies
Depends on #21.
Size: ~2 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.Implemented in
98e159a— full pipeline green (CI lint/typecheck/test, auth e2e, CD build/deploy/smoke/promote): https://gitea.101010.cloud/stwaidele/dorfteich/commit/98e159a8 new e2e tests cover create (empty Yjs state, title-derived slug + duplicate-title suffixes), content-cache derivation on state save (verified against a real Yjs-encoded fixture doc), the 5 MiB size limit (413
page_document_too_large), invalid Yjs bytes (400invalid_page_state), title-only rename keeping the slug stable, explicit slug change with uniqueness validation (409slug_taken), soft delete, and pond-scoped 404s for outsiders.Note: this issue's scope needed #24 (editor schema in packages/shared) as a real prerequisite for the content-cache derivation, even though only #21 was listed under Dependencies — implemented #24 first in this session, closed separately.