LearnNewsExamplesServices
Frontmatter
id8134
titleFix infinite recursion in mount() when useVdomWorker is false
stateClosed
labels
bugai
assigneestobiu
createdAtDec 17, 2025, 2:54 AM
updatedAtDec 17, 2025, 3:01 AM
githubUrlhttps://github.com/neomjs/neo/issues/8134
authortobiu
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtDec 17, 2025, 3:01 AM

Fix infinite recursion in mount() when useVdomWorker is false

Closed v11.17.0 bugai
tobiu
tobiu commented on Dec 17, 2025, 2:54 AM

The recent refactoring of mount() to return initVnode(true) introduced a regression when Neo.config.useVdomWorker is set to false.

The Issue:

  1. Remote Execution (Standard): When useVdomWorker is true, Neo.vdom.Helper.create is accessed via Remote Method Access (RMA). The VDom worker executes the method and sends a reply message. The Neo.worker.Manager in the main thread intercepts this reply, detects autoMount: true, and applies the DOM deltas before forwarding the reply to the App worker.
  2. Local Execution (No Worker): When useVdomWorker is false, Helper.create runs locally in the App Worker. It returns a plain object directly. No worker messages are generated, so the Manager never intercepts the result to update the DOM.
  3. Recursion: The previous code handled this by calling me.mount(). Since mount() was refactored to call initVnode(true), this created an infinite loop.

The Fix: We need to manually trigger the DOM update inside initVnode when running locally.

Task: Modify src/mixin/VdomLifecycle.mjs:

  • In initVnode(), remove the recursive call autoMount && !useVdomWorker && me.mount().
  • Replace it with logic that explicitly constructs the insertNode delta (using the data returned from Helper.create) and sends it to the main thread via Neo.applyDeltas.

This restores the mounting functionality for the non-worker VDOM configuration without relying on the now-circular mount() method.

tobiu added the bug label on Dec 17, 2025, 2:54 AM
tobiu added the ai label on Dec 17, 2025, 2:54 AM
tobiu assigned to @tobiu on Dec 17, 2025, 3:00 AM
tobiu referenced in commit 6fe072a - "Fix infinite recursion in mount() when useVdomWorker is false (#8134)" on Dec 17, 2025, 3:00 AM
tobiu closed this issue on Dec 17, 2025, 3:01 AM