Skip to content

Fix stuck changes-since-review progress - #8897

Open
Christof Marti (chrmarti) wants to merge 2 commits into
mainfrom
chrmarti/fix-changes-since-review-progress
Open

Fix stuck changes-since-review progress#8897
Christof Marti (chrmarti) wants to merge 2 commits into
mainfrom
chrmarti/fix-changes-since-review-progress

Conversation

@chrmarti

@chrmarti Christof Marti (chrmarti) commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Prevent the changes-since-review progress indicator from remaining active when refreshing pull request data fails.

Session Context

Key decisions from the development session:

  • Always settle progress: The refresh is wrapped in ProgressHelper.run, which ends progress in a finally block so network and GitHub API failures cannot leave the Changes in Pull Request view loading indefinitely.
  • Preserve error handling: run does not catch or replace task failures. The original error continues to propagate to the extension's existing logging and error handling.
  • Regression coverage: The new test verifies both that progress ends and that the original failure is rethrown.
  • Observed failure: The issue was reproduced while pull request initialization encountered a 10-second connection timeout to api.github.com.

Changes

  • Add ProgressHelper.run to pair progress start/end around asynchronous work.
  • Use the helper when changes-since-review data triggers comment and diff refreshes.
  • Add a regression test for the rejected-task path.

Log Excerpt

Local workspace paths are shortened below.

2026-08-24 22:36:47.683 [debug] [WorkspaceContextProvider] Skipping workspace chat context for folder file:///…/vscode-telemetry-docs: Connect Timeout Error (attempted address: api.github.com:443, timeout: 10000ms)
2026-08-24 22:36:47.683 [error] [Review+0] Failed to initialize PR data HttpError: Connect Timeout Error (attempted address: api.github.com:443, timeout: 10000ms)
2026-08-24 22:36:47.683 [debug] [WorkspaceContextProvider] Skipping workspace chat context for folder file:///…/vscode: Connect Timeout Error (attempted address: api.github.com:443, timeout: 10000ms)

Validation

  • npm test — 477 passing
  • npm run lint
  • npm run hygiene
  • git diff --check

Screenshot

Pasted Image

Always end the changes-since-review progress when refreshing PR data fails, while preserving the original error for existing logging and handling.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes stuck Changes in Pull Request progress when refresh operations fail.

Changes:

  • Adds failure-safe progress handling.
  • Wraps refresh operations with progress cleanup.
  • Adds regression coverage for rejected tasks.
Show a summary per file
File Summary
src/view/reviewManager.ts Uses the progress helper during refresh handling.
src/view/progress.ts Guarantees progress completion.
src/test/view/progress.test.ts Tests cleanup and error propagation.

Review details

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 3/3 changed files
  • Comments generated: 0
  • Review effort level: Lite

@alexr00
Alex Ross (alexr00) marked this pull request as ready for review August 27, 2026 11:09
Copilot AI review requested due to automatic review settings August 27, 2026 11:09
@alexr00
Alex Ross (alexr00) enabled auto-merge (squash) August 27, 2026 11:09
alexr00
Alex Ross (alexr00) approved these changes Aug 27, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review details

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

src/test/view/progress.test.ts:25

  • The test asserts progress completion via a then callback plus an extra microtask tick (await Promise.resolve()), which is more indirect and can be flaky if scheduling changes. You can make this deterministic by awaiting helper.progress after the rejection, which directly verifies that progress settled even when run() rethrows.
		helper.progress.then(() => {
			progressEnded = true;
		});

		await assert.rejects(task, candidate => candidate === error);
  • Files reviewed: 3/3 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

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.

3 participants