Skip to content

Fix stale native text being marked synchronized - #1876

Merged
cyanzhong merged 1 commit into
mainfrom
develop
Nov 12, 2026
Merged

cyanzhong merged 1 commit into
mainfrom
develop

Conversation

@cyanzhong

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues block the changes to document synchronization and deferred edit notifications.

No open issues 🎉

What changed in this PR

This PR prevents stale native document text from being marked synchronized, while preserving deferred synchronization between the web editor and macOS document model.

Changes:

  • Tracks content changes during text retrieval and preserves the outdated flag when retrieval fails or newer edits arrive.
  • Preserves pending edit notifications across debounced selection updates and cancels completion when needed.
  • Adds regression tests for synchronization failures, concurrent edits, and debounced notifications.
File Description
MarkEditMac/​Tests/​EditorDocumentSaveTests.swift Tests failed retrieval and edits during synchronization.
MarkEditMac/​Sources/​Editor/​Models/​EditorDocument.swift Clears the outdated flag only after successful retrieval without intervening changes.
CoreEditor/​test/​utils/​setup.ts Adds a native completion mock for input tests.
CoreEditor/​test/​input.test.ts Tests pending edit notifications across selection changes.
CoreEditor/​src/​modules/​input/​index.ts Retains pending edit state until notification and handles completion cancellation.

Review effort: Balanced

@cyanzhong
cyanzhong merged commit 17752d4 into main Nov 12, 2026
2 checks passed
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.

2 participants