[pull] develop from marktext:develop#112
Merged
Merged
Conversation
* 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 : )