Skip to content

fix(markdown): persist browser editor changes [5/5] - #2971

Draft
George Ng (GeorgeNgMsft) wants to merge 4 commits into
georgengmsft-markdown-browser-serverfrom
georgengmsft-markdown-browser-persistence
Draft

fix(markdown): persist browser editor changes [5/5]#2971
George Ng (GeorgeNgMsft) wants to merge 4 commits into
georgengmsft-markdown-browser-serverfrom
georgengmsft-markdown-browser-persistence

Conversation

@GeorgeNgMsft

@GeorgeNgMsft George Ng (GeorgeNgMsft) commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Final layer of the replacement stack for #2940, rebased onto the latest #2969 (georgengmsft-markdown-browser-server).

  • persist browser autosave and explicit saves with binding tokens and expected revisions
  • preserve serialized Markdown syntax and surface serializer failures
  • reject stale or incomplete binding, snapshot, switch, and revision data
  • reconcile identical-content conflicts while retrying transient binding contention
  • preserve nested document paths, opaque collaboration room IDs, and browser history
  • coordinate primary autosave ownership without allowing secondary or reconnect events to bless unseen content

Adversarial review

Two independent principal-level reviews used GPT-6 Astra and Grok 4.6. Their validated findings were fixed:

  • stale content could overwrite newer disk content after primary promotion, secondary autosave events, or SSE reconnects
  • temporary update-lock conflicts could permanently suppress autosave retries
  • initial editor content could be treated as a user edit and rewritten on the first autosave interval
  • Back/Forward navigation could add history entries or resolve rapid switches to the wrong document
  • memory-only secondary clients could fail to become the primary autosave client after election
  • accepted snapshots could retain stale conflict suppression

Focused regression coverage was added for these cases. No unresolved high-confidence findings remain after synthesis and follow-up review.

Validation

  • pnpm run build packages/agents/markdown
  • full Markdown local suite: 12 suites, 113 tests passed
  • pnpm run prettier:changed
  • lint ratchet: passed (changed-file violations 182 → 178)
  • complexity ratchet: passed (over-threshold counts unchanged; no new-file function over limits)
  • circular-dependency ratchet: passed (220 → 220)
  • test-debt gate: passed (no focused or newly skipped tests)
  • git diff --check

The local dependency preflight was run in warning mode because this worktree's existing native better-sqlite3 rebuild state caused automatic pnpm install to fail before commands started. The actual TypeScript/Vite build, Jest tests, formatting, and all CI ratchets completed successfully against the installed dependency graph.

The rebased layer changes 1,216 lines across 9 files (+1,068/-148), below the 1,500-line cap.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@GeorgeNgMsft
George Ng (GeorgeNgMsft) force-pushed the georgengmsft-markdown-browser-persistence branch from 2325426 to 874caee Compare September 11, 2026 07:07
@GeorgeNgMsft George Ng (GeorgeNgMsft) changed the title fix(markdown): persist browser editor changes fix(markdown): persist browser editor changes [5/5] Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant