Skip to content

Commit 2fd53fc

Browse files
Copilotalexr00
andauthored
Address review feedback: add comment to catch block, tighten test assertion
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>
1 parent f1d810d commit 2fd53fc

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/issues/stateManager.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,9 @@ export class StateManager {
356356
issueItem.uri = folderManager.repository.rootUri;
357357
return issueItem;
358358
});
359-
} catch (e) {
359+
} catch {
360+
// Errors from fetching issues are expected (e.g. network failures).
361+
// Return undefined so the tree shows an empty state for this query.
360362
return undefined;
361363
} finally {
362364
this._onDidChangeIssueData.fire();

src/test/issues/stateManager.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ describe('StateManager branch behavior with useBranchForIssues setting', functio
255255
await (sm as any).setIssueData(mockFolderManager);
256256

257257
// The event should fire at least twice: once from setIssues (per-query) and once from setIssueData (final)
258-
assert.ok(changeEventCount >= 2, `onDidChangeIssueData should fire at least twice, but fired ${changeEventCount} times`);
258+
assert.strictEqual(changeEventCount, 2, `onDidChangeIssueData should fire exactly twice for a single query, but fired ${changeEventCount} times`);
259259
} finally {
260260
vscode.workspace.getConfiguration = originalGetConfiguration;
261261
}

0 commit comments

Comments
 (0)