Skip to content

Event listeners leak in GraphArea, Header, TabBar, File-drag-drop, no useEffect cleanup #301

@avinxshKD

Description

@avinxshKD

Several components add event listeners in useEffect but never clean them up. Each remount stacks another listener on top of the old ones.

GraphArea.jsx adds a resize listener with an anonymous arrow... no way to remove it. File-drag-drop.jsx does the same with drag events on document.body. Header.jsx and TabBar.jsx register hotkey bindings and never unbind them. The hotkey ones are worse because the callbacks capture initial state via closure, so after remount you get duplicate firings with stale data

Easy to verify , mount/unmount a graph tab a few times and check getEventListeners(window) in devtools. The list grows.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions