Skip to content

Fix issues tree view stuck empty until git commit#8638

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/fix-issues-view-refresh
Draft

Fix issues tree view stuck empty until git commit#8638
Copilot wants to merge 3 commits intomainfrom
copilot/fix-issues-view-refresh

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 1, 2026

The Issues panel could get permanently stuck empty on startup because setIssues() only fired _onDidChangeIssueData on the success path. If getIssues() 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 triggering updateRepository()setIssueData() which would retry the fetch.

Changes

  • setIssues() — Replaced new Promise(async executor) anti-pattern with proper async/await. Errors now resolve with undefined instead of rejecting, and the change event fires in a finally block:
private async setIssues(folderManager, query): Promise<IssueItem[] | undefined> {
    try {
        const issues = await folderManager.getIssues(query, ...);
        return issues?.items.map(...);
    } catch {
        return undefined;
    } finally {
        this._onDidChangeIssueData.fire();
    }
}
  • setIssueData() — Added _onDidChangeIssueData.fire() at the end as a guaranteed final refresh signal after all queries are processed, covering the edge case where _queries is empty or all per-query fires were somehow missed.

  • Tests — Added coverage for: event fires on getIssues error, event fires twice per setIssueData call (per-query + final), and issueCollection promises resolve rather than reject on error.

Copilot AI and others added 2 commits April 1, 2026 14:55
… 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>
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
Copilot AI requested a review from alexr00 April 1, 2026 15:02
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.

Issues view fails to load or refresh until a git commit is performed

2 participants