Files
pages/docs/design/revision-listing.md
T
Anya Tokugawa c1175d389f Implement Knowledge City platform, organizer and DAV integration
Capture accumulated application, UI, CLI, regression tests and design documentation changes, including task project mapping and default CalDAV list naming.

Keep deployment data, backups, local credentials and build artifacts out of Git. Move the Compose enrollment token to an ignored local environment file.
2026-09-27 14:44:43 +09:00

2.1 KiB
Raw Blame History

Bounded Revision history

Implemented 2026-09-14 for /_/api/v1/revisions/list?uuid=<Object UUID> and /r/history/<Object UUID>. Both authorize the Object before loading metadata. Path-scoped users can use the API through the handler resolver; a Domain-wide read grant is not additionally required.

  • Default 100, maximum 200 records per response; limit outside 1–200 is 400.
  • before=<Revision UUID> is an exclusive cursor in the same Object. A missing or foreign-Object cursor is 400 after Object authorization.
  • Order is created_at_ms DESC, rowid DESC, preserving insertion order when timestamps tie. The ascending (object_uuid, created_at_ms) index supports backward keyset scans. Newer writes do not shift subsequent pages.
  • Only metadata is selected, never Revision bodies. Message and filename previews are capped at 4,096 characters each. Queries have a two-second context and one read snapshot; at most 201 records are materialized.
  • The API retains its JSON-array shape. Link: <...>; rel="next" and X-Next-Cursor advertise continuation. An empty result is []; HEAD returns headers without a JSON body. Responses are private, no-store.
  • History has localized older/newest navigation. Legacy editor history dialogs link to this browser when another page exists. Messages use DOM text nodes; they are never interpolated into markup or inline event handlers.

Restore accepts POST only, and checks source metadata authority before loading the body. The legacy dialog now uses POST. Reusing immutable Document hashes for restore without full payload hydration is a separate follow-up; no claim of streaming or constant-memory large-binary restore is made here.

Trusted Store/CLI ListRevisions remains available for explicit full exports. Clients that previously assumed the HTTP array contained all history must follow the next link. A cursor removed by retention expires rather than silently restarting at the newest revision. Tests cover equal timestamps, concurrent newer insertion, cancellation, foreign cursors, limits, HEAD, ACL revocation, localized navigation and escaped messages.