Skip to content

feat(docs): refuse a stale document save instead of overwriting another editor - #571

Merged
imshashank merged 203 commits into
Noveum:mainfrom
ayam04:fix/200-doc-revision
Nov 17, 2026
Merged

imshashank merged 203 commits into
Noveum:mainfrom
ayam04:fix/200-doc-revision

Conversation

@ayam04

@ayam04 ayam04 commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

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.

Pallavikumarimdb and others added 30 commits September 24, 2026 00:07
@github-actions github-actions Bot added documentation Docs, the README, or anything that explains Orbit area: mcp The MCP server, its tools and its OAuth area: auth Sign-in, sessions, passkeys, OAuth area: policy Roles, permissions and authorization area: integrations GitHub, Slack and webhooks dependencies Dependency updates labels Nov 16, 2026
@github-actions github-actions Bot removed documentation Docs, the README, or anything that explains Orbit area: mcp The MCP server, its tools and its OAuth area: auth Sign-in, sessions, passkeys, OAuth labels Nov 17, 2026
@imshashank imshashank added the preview Enables a Preview for an otherwise eligible draft after CI succeeds label Nov 17, 2026 — with ChatGPT Codex Connector

Copy link
Copy Markdown
Contributor

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 useUpdateDoc raises another "Could not save" toast on top of the banner. Second, adoptsRemoteEdit returns false when the title and body are unchanged, so the revision is not adopted. A restore to identical content bumps the revision on purpose, which means every other open editor gets a false conflict on its next save.

Smaller things: baseRevision should be positive rather than nonnegative, and the MCP update_doc tool still overwrites without a revision, which is fine as a follow up if we note it. This also depends on #567 landing first because 0040 chains from its 0039, so the description should say that.


Generated by Claude Code

@github-actions github-actions Bot removed area: policy Roles, permissions and authorization area: integrations GitHub, Slack and webhooks dependencies Dependency updates labels Nov 17, 2026
@imshashank
imshashank marked this pull request as ready for review November 17, 2026 08:50
@imshashank
imshashank merged commit 8abaf0b into Noveum:main Nov 17, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: database Schema, migrations, queries, seed area: docs-feature The docs product and its editor area: web The Next.js app and its UI preview Enables a Preview for an otherwise eligible draft after CI succeeds tests Test coverage and test infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reject stale document saves instead of overwriting another editor

5 participants