Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở Phù hợp với người mới
#9,143 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
74/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
github, typescript, vscode
Lĩnh vực
devtools

Hướng nghiên cứu

Bắt đầu từ phần triển khai bảng tổng quan PR và theo dõi refreshPanel(), updateItem() cùng cách xử lý việc hủy bảng; issue chỉ ra mã đã rút gọn trong dist/extension.js làm tài liệu tham khảo. Tái hiện lỗi bằng cách merge từ tab mô tả khi bật hai cài đặt đã nêu, sau đó xác minh rằng việc hủy bảng trong lúc đang chờ làm mới không còn hiển thị lỗi dưới dạng toast, còn lỗi làm mới thực sự vẫn được hiển thị.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
TypeScript
Star
2.6k
Fork
807
Merge trung bình
1 ngày 6 giờ
Pull request đã merge (30 ngày)
75

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của microsoft/vscode-pull-request-github

Tất cả issue của microsoft/vscode-pull-request-github

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.