Skip to content

[pull] develop from marktext:develop#112

Merged
pull[bot] merged 3 commits into
code:developfrom
marktext:develop
Jul 4, 2026
Merged

[pull] develop from marktext:develop#112
pull[bot] merged 3 commits into
code:developfrom
marktext:develop

Conversation

@pull

@pull pull Bot commented Jul 4, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

FahimFBA and others added 3 commits July 4, 2026 09:36
* Add Bengali README and links

Add a Bengali (bn) translation at docs/i18n/README-bn.md and update the main README and i18n README files to include a Bangladesh (🇧🇩) link/icon.

* fix(i18n): replace Bangladesh flag emoji with text representation in README files
ot-json1.compose() may legitimately return the identity operation (null) when queued operations cancel each other out, such as during IME composition.

JSONState._flushOperationCache() assumed that any non-empty operation batch would compose to a non-null operation and emitted it through the json-change event. Downstream consumers such as History expected a JSONOpList and crashed when receiving null.

Skip emitting json-change for identity operations to preserve the ot-json1 contract and avoid forwarding no-op operations.
)

* fix(muya): tolerate identity (null) json-change ops in History

`ot-json1.compose()` legitimately returns the identity operation (`null`)
when queued operations cancel each other out (for example during IME
composition). PR #4815 stopped the deferred-flush emitter from forwarding
that null, but `dispatch()` — used by `Editor.updateContents` and
`rebuildContents` — still forwards it deliberately, and the `updateContents`
contract explicitly routes the no-op through `json-change`.

`History`'s `json-change` listener passed the op straight to `_record`
(and `_transform`), both of which read `op.length` and crash on `null`
with `TypeError: Cannot read properties of null (reading 'length')`.

Ignore identity ops in the listener: a no-op has nothing to record or
transform. This closes the crash at the consumer regardless of which
emitter produced the null.

Refs #4806

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* test(muya): cover identity-op json-change crash (#4806)

Two regressions for the null-op crash:

- `updateContents(null)` drives the `dispatch` path that forwards the
  identity op through `json-change`; asserts History neither crashes nor
  records an undo entry.
- Flushing a compose-to-null batch (an op and its exact inverse) asserts
  the deferred-flush emitter stays silent, locking the PR #4815 fix.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@pull pull Bot locked and limited conversation to collaborators Jul 4, 2026
@pull pull Bot added the ⤵️ pull label Jul 4, 2026
@pull pull Bot merged commit 2b9c18e into code:develop Jul 4, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants