Repository navigation
feat(docs): refuse a stale document save instead of overwriting another editor - #571
Conversation
…y, atomic upserts and complexity
…ation, test coverage and accessibility
…, and error handling
… optimistic concurrency check
…e envelope validation
…e envelope validation
…provider switch defaults
|
Went through the document layer on its own, on top of #567. The server side is right: the revision check sits in the UPDATE's own WHERE so it is atomic, permissions run first, and no other writer is broken. CI is green on 671360e. Two client bugs before this leaves draft. First, nothing stops autosave while the conflict banner is up, so every typing pause sends the same dead baseRevision again and Smaller things: Generated by Claude Code |
Document revisions reject stale body saves atomically while retaining legacy saves that omit a base revision. Renames and moves do not advance the body revision; restoring changed content does. Preserves @ayam04's original implementation and contribution history in this PR.
The conflict editor keeps the local draft until an explicit refresh successfully loads the newer revision. Failed refreshes cannot adopt stale cached data. An existing background fetch is cancelled before the forced refresh, preventing it from satisfying that action with an old result. Focused regressions cover these paths.
Reviewed head 647dd5e integrates actual main 3929a3a. Its entire tree equals verified source d884429: canonical full verification passed 7,367 tests, zero failures/skips, actual exit 0, unchanged source and all eight owned targets subsequently idle. All six fresh application CI jobs, CodeQL, recovery matrix and link checks pass. All review threads are resolved. Released migration history and lock bytes remain unchanged.
Production migrations 0039 and 0040 are recorded and independently verified through exactly 41 entries in Bun and Node, including the full required catalog. The original release wrapper's output-format stop after canonical command exit 0 is preserved; no migration reapplication or rollback occurred.
Normal preview https://orbit-mlhedp4om-magicapi.vercel.app (dpl_EANj9uGdL1cz7AeP7VMtSg9EXqDB) is READY. Its actual build passed the required schema check. The ordinary CLI upload was independently matched across all 2,040 tracked files to this exact tree. Because the automatic controller excludes forks, a reviewed manual preview was used without changing controller eligibility. Public aliases, production target, all five crons, firewall12 and automatic-domain-assignment settings stayed unchanged. This establishes source/build/schema readiness, not live third-party transactions or unrestricted preview backend access.
Ready for normal squash merge. Fixes #200.