Fix issues tree view stuck empty until git commit#8638
Draft
Conversation
… tree refresh The issues tree view could get permanently stuck empty because: 1. `setIssues()` used the `new Promise(async executor)` anti-pattern and only fired `_onDidChangeIssueData` on success. If `getIssues()` threw (e.g. due to a transient network error), the promise rejected silently, the event never fired, and the tree never learned to refresh. 2. `setIssueData()` didn't fire `_onDidChangeIssueData` after processing all queries, so if all queries failed, the tree stayed permanently empty until a git commit triggered a new `setIssueData` call. Fix: - Refactor `setIssues()` to use async/await properly, catch errors gracefully (resolving with undefined instead of rejecting), and fire the change event in a `finally` block so it always fires. - Fire `_onDidChangeIssueData` at the end of `setIssueData()` to guarantee the tree always gets a refresh signal after data loading completes. Agent-Logs-Url: https://github.com/microsoft/vscode-pull-request-github/sessions/42a1cce0-564c-42dd-afc9-909f2730d385 Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
…ertion Agent-Logs-Url: https://github.com/microsoft/vscode-pull-request-github/sessions/42a1cce0-564c-42dd-afc9-909f2730d385 Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix issues view failing to load until git commit
Fix issues tree view stuck empty until git commit
Apr 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Issues panel could get permanently stuck empty on startup because
setIssues()only fired_onDidChangeIssueDataon the success path. IfgetIssues()threw (e.g. transient network error), the promise rejected silently, the tree data provider was never notified, and no subsequent refresh was triggered. A git commit would unstick it by triggeringupdateRepository()→setIssueData()which would retry the fetch.Changes
setIssues()— Replacednew Promise(async executor)anti-pattern with properasync/await. Errors now resolve withundefinedinstead of rejecting, and the change event fires in afinallyblock:setIssueData()— Added_onDidChangeIssueData.fire()at the end as a guaranteed final refresh signal after all queries are processed, covering the edge case where_queriesis empty or all per-query fires were somehow missed.Tests — Added coverage for: event fires on
getIssueserror, event fires twice persetIssueDatacall (per-query + final), andissueCollectionpromises resolve rather than reject on error.