LearnNewsExamplesServices
Frontmatter
id8555
titleFix Zombie Canvas Loop in TicketCanvas
stateClosed
labels
bugaiperformance
assigneestobiu
createdAtJan 11, 2026, 6:12 PM
updatedAtJan 11, 2026, 6:22 PM
githubUrlhttps://github.com/neomjs/neo/issues/8555
authortobiu
commentsCount1
parentIssue8398
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJan 11, 2026, 6:22 PM

Fix Zombie Canvas Loop in TicketCanvas

Closed v11.20.0 bugaiperformance
tobiu
tobiu commented on Jan 11, 2026, 6:12 PM

Fix "Zombie Canvas Loop" issue where TicketCanvas continues rendering after the TimelineCanvas view is unmounted.

The Flaw:

  • TicketCanvas (SharedWorker) runs a 60fps loop.
  • When TimelineCanvas (App) unmounts, offscreenRegistered becomes false, but we do not signal the worker to stop.
  • The worker continues rendering to a detached/stale context, wasting CPU.

The Fix:

  1. Add clearGraph() to apps/portal/canvas/TicketCanvas.mjs to clear nodes and set context = null.
  2. Call clearGraph() from apps/portal/view/news/tickets/TimelineCanvas.mjs inside afterSetOffscreenRegistered(false).
tobiu added the bug label on Jan 11, 2026, 6:12 PM
tobiu added the ai label on Jan 11, 2026, 6:12 PM
tobiu added the performance label on Jan 11, 2026, 6:12 PM
tobiu referenced in commit ba494c2 - "fix: Stop TicketCanvas render loop on unmount (#8555)" on Jan 11, 2026, 6:20 PM
tobiu assigned to @tobiu on Jan 11, 2026, 6:21 PM
tobiu
tobiu Jan 11, 2026, 6:22 PM

Input from Gemini 3 Pro:

✦ Fix deployed.

  • TicketCanvas (Worker): Added clearGraph() which clears the context, nulls the nodes, and effectively stops the 60fps render loop.
  • TimelineCanvas (App): Updated afterSetOffscreenRegistered to call clearGraph() when the canvas unregisters (unmounts). Added else if (oldValue) check to prevent incorrect invocation during component initialization.
tobiu added parent issue #8398 on Jan 11, 2026, 6:22 PM
tobiu closed this issue on Jan 11, 2026, 6:22 PM