Skip to content

fix(sidebar): dispose message listener on view reopen to prevent memory leaks - #35

Merged
Adnan9-63 merged 1 commit into
mainfrom
fix/sidebar-message-listener-leak
Oct 24, 2026
Merged

Adnan9-63 merged 1 commit into
mainfrom
fix/sidebar-message-listener-leak

Conversation

@Adnan9-63

Copy link
Copy Markdown
Member

Description

Fixes #30.

  • In \src/sidebar.js,
    esolveWebviewView\ previously attached a new message listener to \ his.context.subscriptions\ on every call without disposing the previous listener, resulting in accumulated duplicate listeners when toggling the sidebar view.
  • Stores the active message listener disposable and disposes any previous listener upon view re-resolution or view disposal.
  • Registers \sidebarProvider\ in \context.subscriptions\ with a \dispose()\ hook.
  • Adds regression unit test in \ ests/sidebar.test.js.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New unit tests (adds regression test)

Copilot AI balanced review requested due to automatic review settings October 24, 2026 20:14

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@Adnan9-63
Adnan9-63 merged commit 0d264c4 into main Oct 24, 2026
3 checks passed
@Adnan9-63
Adnan9-63 deleted the fix/sidebar-message-listener-leak branch October 24, 2026 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Prevent memory leak in Sidebar webview message listener on view reopen

2 participants