Skip to content

bug(manager-dashboard): recipe-updated document listener never removed (leak) #321

@roiguri

Description

@roiguri

Refs #267

Source: Deep code review — docs/code-review-2026-05.md (finding B1, P1).

Where: src/app/pages/manager-dashboard-page.js:162 (registered in setupEditRecipeListener()), no removal in unmount() (~:46).

Issue: document.addEventListener('recipe-updated', ...) is added on every dashboard visit with no teardown. Each navigation cycle adds another listener → duplicate refreshRecipes() calls and a growing memory leak.

Fix: Store the bound handler on this._onRecipeUpdated, attach with that reference, and remove it in unmount(). (Longer term this is what the proposed event-bus R1 would solve centrally.)

Verification: Chrome DevTools → Memory allocation timeline; navigate to/from dashboard 20× and confirm retained size stays flat.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions