Merging from the PR description tab shows "Error refreshing pull request description: Webview is disposed"

Open Beginner friendly
#9,143 0 comments 1 reaction 2 assignees View on GitHub

Maintainers usually reply within 1 day

@alexr00 is already working on this.

Since Nov 2, 2026.

  • #9145 by @copilot-swe-agent — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
74/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
github, typescript, vscode
Domain
devtools

Research direction

Start in the PR overview panel implementation and trace refreshPanel(), updateItem(), and the panel’s disposal handling; the issue identifies the minified code in dist/extension.js as a reference. Reproduce by merging from the description tab with the two stated settings enabled, then verify disposal during an awaited refresh no longer shows an error toast while genuine refresh errors still do.

Written by the indexing model from the issue text.

Description

Bug. After merging a PR from the PR description tab, VS Code shows the error toast Error refreshing pull request description: Webview is disposed. The merge itself, the branch deletion and the checkout all succeed; the tab was going to close anyway, so the toast is noise.

Steps

  1. Set "githubPullRequests.deleteBranchAfterMerge": true and "githubPullRequests.postDone": "checkoutDefaultBranchAndPull".
  2. Check out a PR branch and open its description tab.
  3. Merge the PR from the tab.

Expected: the tab closes with no notification.
Actual: the tab closes and the error toast appears every time.

Cause (read from the code, not stepped through). the PR overview panel's refreshPanel() (minified in dist/extension.js, v0.174.0) checks this._panel.visible and this._refreshing once, then awaits resolveModel(...) and updateItem(...); its catch shows the toast:

async refreshPanel() {
  if (!(!this._panel.visible || this._refreshing)) {
    this._refreshing = true;
    try {
      const e = await this.resolveModel(this._identity);
      if (!e) throw new Error(`Failed to resolve Pull Request #...`);
      await this.updateItem(e);
    } catch (e) {
      window.showErrorMessage(`Error refreshing pull request description: ${...}`);
    } finally { this._refreshing = false; }
  }
}

After a merge the extension disposes the panel (PR done, branch deleted, default branch checked out) while a refresh that started earlier is still awaiting the model. When it resumes, updateItem posts to a disposed webview and throws.

Suggested fix. Track disposal (an onDidDispose flag, or re-check the panel after each await) and return quietly instead of calling showErrorMessage when the panel is gone. Related closed reports with the same message but other triggers: #2444, #4847, #5037.

Environment: extension 0.174.0, VS Code 1.144.0, Windows 11.

Dominant language
TypeScript
Stars
2.6k
Forks
811
Avg merge
1d 9h
Merged PRs (30d)
69

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/vscode-pull-request-github

All issues in microsoft/vscode-pull-request-github

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.