Frontmatter
| id | 8549 |
| title | Fix duplicate listener on TimelineCanvas during navigation |
| state | Closed |
| labels | bugai |
| assignees | tobiu |
| createdAt | Jan 11, 2026, 4:25 PM |
| updatedAt | Jan 11, 2026, 4:32 PM |
| githubUrl | https://github.com/neomjs/neo/issues/8549 |
| author | tobiu |
| commentsCount | 1 |
| parentIssue | 8398 |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Jan 11, 2026, 4:32 PM |
Fix duplicate listener on TimelineCanvas during navigation
tobiu assigned to @tobiu on Jan 11, 2026, 4:30 PM

tobiu
Jan 11, 2026, 4:30 PM
Input from Gemini 3 Pro:
✦ I have moved the store listener attachment from
afterSetOffscreenRegisteredtoonConstructed.Why:
afterSetOffscreenRegisteredtoggles between true/false when the component is mounted/unmounted (e.g., navigating between views).- Since the component instance is cached and reused,
afterSetOffscreenRegisteredfired repeatedly, adding a new listener each time without cleanup.onConstructedfires only once per instance. By attaching the listener there, we ensure it is added exactly once for the lifetime of the component.afterSetOffscreenRegisterednow correctly handles the "ready" state toggling (isCanvasReady) and manual data synchronization on re-mount, without managing listeners.This resolves the "Duplicate event handler attached" error while preserving correct behavior.
tobiu added parent issue #8398 on Jan 11, 2026, 4:32 PM
tobiu closed this issue on Jan 11, 2026, 4:32 PM
When navigating between the Tickets and Release views in the Portal app,
TimelineCanvasaccumulates duplicateloadevent listeners on theContentSectionsstore.This happens because
Canvas.mjstogglesoffscreenRegisteredtofalseon unmount andtrueon mount.TimelineCanvasadds a listener whenoffscreenRegisteredbecomestrue, but fails to remove it when it becomesfalse.Fix:
apps/portal/view/news/tickets/TimelineCanvas.mjsto unsubscribe from the store whenoffscreenRegisteredis set tofalse.isCanvasReadytofalseon cleanup.