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

Aperta Adatta ai principianti
#9,143 0 commenti 1 reazione 2 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@alexr00 ci sta già lavorando.

Dal 2/11/2026.

  • #9145 di @copilot-swe-agent — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
74/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
github, typescript, vscode
Ambito
devtools

Direzione di ricerca

Inizia dall’implementazione del pannello di riepilogo della PR e segui refreshPanel(), updateItem() e la gestione dello smaltimento del pannello; l’issue indica come riferimento il codice minificato in dist/extension.js. Riproduci il problema eseguendo il merge dalla scheda di descrizione con le due impostazioni indicate abilitate, quindi verifica che lo smaltimento durante un aggiornamento in attesa non mostri più un errore come notifica toast, mentre gli errori reali di aggiornamento continuino a essere mostrati.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
TypeScript
Stelle
2.6k
Fork
811
Merge medio
1g 5h
PR unite (30g)
65

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di microsoft/vscode-pull-request-github

Tutte le issue di microsoft/vscode-pull-request-github

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.