+- **Document version history (Hocuspocus):** Stateless `history.list` / `history.watch`; server **unicasts** `{ msg: 'history.response', type, response }` on the requesting connection (not `broadcastStateless`). **Prisma always uses the collab room’s document id** (Hocuspocus `document.name`); if the client sends a different `documentId`, respond `history_failed`. Current `history.list` returns **`{ versions, latestSnapshot }`** for one RTT; client still accepts a legacy plain `HistoryItem[]`. **`applyHistoryItemToEditor`** (`pages/history/applyHistoryToEditor.ts`) is the single TipTap hydration path. **`loadingHistory` clears only after a successful apply** (not merely after the network response); **`useHistoryEditorApplyWhenReady`** applies when the editor mounts after data arrives; while **`pendingWatchVersion` is set** (in-flight `history.watch`), the apply-when-ready hook must **not** re-apply stale `activeHistory`, and **late `history.list` must not** reset pending or hydrate from `latestSnapshot` over that watch. On **`history_failed`**, clear **`pendingWatchVersion`** so the next watch isn’t dropped
0 commit comments