Conditional room saves, so a stale save never overwrites another writer #5
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/XSH-1-conditional-saves"
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?
Part of Kaneo Live region shares for Excalidraw boards (XSH-1).
saveToFirebase(excalidraw-app/data/httpStorage.ts) used to snapshot the scene, read the room, and then PUT unconditionally. A save from another writer between that read and that PUT was overwritten. The other writer could be a second tab or the live-share bridge saving a guest's edit.It now reads the room with its ETag, reconciles exactly as before, and PUTs with
If-Match(orIf-None-Match: *for a new room). On 412 it re-reads, reconciles and retries, up to 5 times. Against a backend without ETags it falls back to the previous unconditional PUT, so it can deploy in either order relative to oss/excalidraw-storage-backend#15.The new test
excalidraw-app/tests/httpStorage.test.tsraces two saves on one room against an ETag-aware backend double. Both elements are kept. On the previous code the same test loses one. Typecheck, ESLint and Prettier are clean, and all 7 app tests pass. Reviewed by GPT-6.1-Sol: PASS.🤖 Generated with Claude Code