LearnNewsExamplesServices
Frontmatter
id8798
titleFix race condition in MagicMoveText.measureChars
stateClosed
labels
bugai
assigneestobiu
createdAtJan 19, 2026, 9:31 AM
updatedAtJan 19, 2026, 9:35 AM
githubUrlhttps://github.com/neomjs/neo/issues/8798
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJan 19, 2026, 9:35 AM

Fix race condition in MagicMoveText.measureChars

Closed v11.23.0 bugai
tobiu
tobiu commented on Jan 19, 2026, 9:31 AM

If onResize triggers measureChars, and afterSetText updates me.chars while getDomRect is pending, a mismatch between the returned rects (from old state) and me.chars (new state) causes a crash. Fix: Add a length check in measureChars to ensure rects matches me.chars before iterating.

tobiu added the bug label on Jan 19, 2026, 9:31 AM
tobiu added the ai label on Jan 19, 2026, 9:31 AM
tobiu assigned to @tobiu on Jan 19, 2026, 9:31 AM
tobiu referenced in commit ee575a9 - "fix: Prevent race condition in MagicMoveText.measureChars (#8798)" on Jan 19, 2026, 9:34 AM
tobiu
tobiu Jan 19, 2026, 9:34 AM

Input from Gemini 3 Pro:

✦ Fixed race condition where measureChars could iterate over mismatching array lengths if onResize triggered concurrently with afterSetText. Added guard checks.

tobiu closed this issue on Jan 19, 2026, 9:35 AM