Repository navigation
Description
An external write to an open Markdown file can erase unsaved visual edits without a conflict confirmation. The document becomes clean, and the tested Undo action does not restore the local text. Preserve recoverable local content until the conflict has been resolved.
Priority: P1 / High — confirmed data loss. The affected synchronization path predates #80; the installed reproduction below applies to its audited candidate. This is distinct from #11's queued-edit/native-Save overlap.
Reproduction and findings
- Save a synthetic document containing
# External conflict, a blank line, andBASE-MARKER. - Open it with Binary Markdown. Append
LOCAL-UNSAVED-MARKERusing the keyboard without saving. - Confirm that the VS Code document is dirty and the file on disk still contains only the original marker. Keep Auto Save off for this reproduction.
- Let typing become idle, then use a separate process to replace the same file with
# External conflict, a blank line, andEXTERNAL-MARKER. - Inspect the visual editor, document dirty state, and disk; focus the visual editor and invoke Undo once.
Observed twice: both the host document and visual editor contain the external revision; the document is clean; no conflict-confirmation dialog appeared; the local marker did not return after the tested Undo action. No conclusion is drawn about separate VS Code backups or operating-system recovery facilities.
Expected: external changes must not silently discard unsaved local content. The conflict must remain recoverable until resolved.
Scope and acceptance criteria
- Define and implement a dirty-document conflict policy that preserves both revisions until resolution; keep ordinary clean-document external reloads working.
- Cover idle and active visual editing, Source mode, delayed watcher events, native/keyboard saves, and undo/recovery with deterministic native regressions.
- Keep own-save notifications from overwriting later edits; preserve the existing save/export synchronization guarantees.
- Correct the external-change guide's promise of review/accept/dismiss controls and an unsaved-edit confirmation so it matches the delivered behavior.
The conflict interaction is a product decision; this issue does not require a full collaborative merge engine. Cross-link #11 when coordinating shared save infrastructure without treating the two reproductions as the same defect.
Source evidence
The file watcher replaces document contents and saves without a dirty-content conflict decision. The webview update handler applies the external revision when idle and clears editor undo. The external-change guide advertises safeguards absent from this observed flow.
Build identity and verification boundary
Recorded during the 2026-09-27 audit of #80 at ffbdad524d393aa783760f4829cb995d8b9d6405 (package version 0.4.0), using Node 24.21.0 on macOS ARM64. The tested product source was unmodified. This is an unreleased development snapshot.
Reproduced in the installed VSIX with VS Code 1.138.0 using an isolated owned profile and synthetic documents. Package SHA-256: b813d91c719b8530ea2bbce18dcf924fd605ed7fc0f689d2b5a2f1305d3092fe. These are native host/filesystem observations; other operating systems were not retested for this case.
Reproduce and validate changes using the checkout's build guide and testing guide. Keep evidence synthetic and sanitized.
Activity
fix: close scope-audit findings for external-change conflicts (#81)
Merge pull request #110 from BinaryOutlook/feat/external-write-conflict