[1/5] fix(muya): validate asynchronous edit targets by Jocs · Pull Request #5799 · marktext/marktext · GitHub
Skip to content

[1/5] fix(muya): validate asynchronous edit targets - #5799

Merged
Jocs merged 1 commit into
developfrom
split/muya-async-target-validation
Oct 20, 2026
Merged

Jocs merged 1 commit into
developfrom
split/muya-async-target-validation

Conversation

@Jocs

@Jocs Jocs commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Relates to #3688, #4532, #3745. Split from #5793, which stays open as layer 5.

Review stack

Review and merge in this order. Each PR targets the preceding branch, so its Files changed tab contains only its own layer.

Layer PR Responsibility
1 #5799 Muya asynchronous target validation
2 #5800 Accessible code copying and clipboard feedback
3 #5801 Muya read-only mode and reading interactions
4 #5802 MarkText document state, IPC and save protection
5 #5793 MarkText controls, menus, shortcuts and shell localization

After a preceding PR merges, retarget/rebase its successor onto develop before merging it. Keep intermediate branches until their downstream PR has been retargeted. #5793 is the original PR, retained and reused.

Summary

Prevent asynchronous paste, image upload, dropped-image and picker callbacks from writing through removed or replaced blocks. Validate the original target against the current mounted editor DOM; scope upload placeholders to that target. The membership check only requires an existing target DOM inside a mounted editor; there is no forwarding wrapper. This layer contains no reading-mode API or controls.

Type of change

  • Bug fix (non-breaking)

Test plan

  • Regression tests included with this layer.
  • Muya full unit suite: 295 files / 2752 tests passed. Muya ESLint/typecheck and root ESLint passed.
  • Automated browser/Electron checks run on macOS where listed.

Notes for reviewers

Layer 1/5 of a linear PR stack. Review the diff against this PR’s base branch; merge in order. The next layer is rebased/retargeted after this one lands.

Follow-up review

Removed repeated membership checks within synchronous paste segments; retained checks at asynchronous write boundaries. Added a delayed-image-lookup regression. Independent Muya suite: 2752 tests passed.

Changes remain in their owning layer; all five existing PRs are retained. Additional IME handling was deferred as requested.


By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.

@Jocs
Jocs force-pushed the split/muya-async-target-validation branch from 3667d37 to 024bebe Compare October 20, 2026 09:23
@Jocs
Jocs merged commit 4d5753a into develop Oct 20, 2026
8 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.

1 participant