Skip to content

Preserve offline Editor edits when another device changes the note - #2026

Merged
callumalpass merged 9 commits into
mainfrom
fix-p1-2022-offline-conflict-loss
Nov 28, 2026
Merged

callumalpass merged 9 commits into
mainfrom
fix-p1-2022-offline-conflict-loss

Conversation

@callumalpass

@callumalpass callumalpass commented Nov 28, 2026 •

Copy link
Copy Markdown
Member

Refs #2022

Editor keeps the browser draft until the device write is confirmed. If the log rejects an offline edit after another device changes the note, Editor shows the remote version and the recovered local text and lets the user choose. Private collection recovery text stays in memory. Each note’s save indicator follows that note’s pending state.

The shared SDK RecordSession reconciles pending body edits, field changes, and removals against the original mutation receipts. It retains later typing when a peer changes the note during confirmation and requires review before another submit.

Native Chromium and CLI validation

The three trials ran sequentially on one Chromium installation using a disposable local cloud copy, the native CLI and daemon, and the browser’s SQLite replica on OPFS.

Trial Observed outcome
Control, offline reload The same mutation survived reload, confirmed as applied, and reached CLI disk.
A, offline reload with a concurrent CLI edit The same pending mutation survived reload. The CLI edit synced first. The browser write was rejected and Editor showed both bodies. Choosing Keep my edits propagated the browser text to CLI disk.
B, no reload before reconnect The CLI edit synced first. The browser write was rejected and Editor showed both bodies. Discarding the recovered draft kept the CLI text on disk, and the dismissal survived a subsequent reload.

Two Chromium regressions also run with the SDK test replica. Product changes are in Editor and the TypeScript SDK. Rust sources and WASM pins are unchanged. Production retesting is separate.

@callumalpass
callumalpass marked this pull request as ready for review November 28, 2026 10:24
@callumalpass
callumalpass added this pull request to the merge queue Nov 28, 2026
Merged via the queue into main with commit 2324c71 Nov 28, 2026
55 checks passed
@callumalpass
callumalpass deleted the fix-p1-2022-offline-conflict-loss branch November 28, 2026 10:52
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