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.
Neo.applyDeltasallows passing a delta object or an array of deltas. However,Neo.worker.Manager.handleDomUpdateexplicitly checksdeltas?.length > 0to 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.lengthis undefined, causing the check to fail and the update to be silently ignored. This issue was identified insrc/calendar/view/month/Component.mjs.Goal: Make
Neo.applyDeltasrobust by ensuring thedeltaspayload sent to the main thread is always an array.Task: Modify
src/worker/App.mjs:applyDeltas(windowId, deltas)to check ifdeltasis 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.