LearnNewsExamplesServices
Frontmatter
id8135
titleEnsure Neo.applyDeltas handles single delta objects
stateClosed
labels
bugaicore
assigneestobiu
createdAtDec 17, 2025, 3:45 AM
updatedAtDec 17, 2025, 3:47 AM
githubUrlhttps://github.com/neomjs/neo/issues/8135
authortobiu
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtDec 17, 2025, 3:47 AM

Ensure Neo.applyDeltas handles single delta objects

Closed v11.17.0 bugaicore
tobiu
tobiu commented on Dec 17, 2025, 3:45 AM

Neo.applyDeltas allows passing a delta object or an array of deltas. However, Neo.worker.Manager.handleDomUpdate explicitly checks deltas?.length > 0 to determine if it should process the update or just send a reply.

If a single object is passed to applyDeltas (e.g., {id: 'foo', cls: {add: ['bar']}}), deltas.length is undefined, causing the check to fail and the update to be silently ignored. This issue was identified in src/calendar/view/month/Component.mjs.

Goal: Make Neo.applyDeltas robust by ensuring the deltas payload sent to the main thread is always an array.

Task: Modify src/worker/App.mjs:

  • Update applyDeltas(windowId, deltas) to check if deltas is an array.
  • If not, wrap it in an array: deltas = Array.isArray(deltas) ? deltas : [deltas];.

This ensures compatibility with the Manager's logic and supports the convenient single-object syntax used throughout the codebase.

tobiu added the bug label on Dec 17, 2025, 3:45 AM
tobiu added the ai label on Dec 17, 2025, 3:45 AM
tobiu added the core label on Dec 17, 2025, 3:45 AM
tobiu assigned to @tobiu on Dec 17, 2025, 3:46 AM
tobiu referenced in commit 49637b5 - "Ensure Neo.applyDeltas handles single delta objects (#8135)" on Dec 17, 2025, 3:47 AM
tobiu closed this issue on Dec 17, 2025, 3:47 AM