Skip to content

The "Refresh Pull Request Comments" command does not work.#8473

Merged
alexr00 merged 1 commit intomainfrom
alexr00/issue8445
Feb 4, 2026
Merged

The "Refresh Pull Request Comments" command does not work.#8473
alexr00 merged 1 commit intomainfrom
alexr00/issue8445

Conversation

@alexr00
Copy link
Member

@alexr00 alexr00 commented Feb 4, 2026

Fixes #8445

Copilot AI review requested due to automatic review settings February 4, 2026 10:36
@alexr00 alexr00 enabled auto-merge (squash) February 4, 2026 10:36
@alexr00 alexr00 self-assigned this Feb 4, 2026
@vs-code-engineering vs-code-engineering bot added this to the February 2026 milestone Feb 4, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the review thread and comment initialization logic in PullRequestModel to eliminate duplicate parsing and improve code maintainability. While the PR claims to fix issue #8445 regarding the "Refresh Pull Request Comments" command not working, the changes only partially address the underlying issues.

Changes:

  • Modified initializeReviewThreadCache() to return IReviewThread[] instead of void, enabling reuse of the fetched threads
  • Refactored initializeReviewThreadCacheAndReviewComments() to reuse threads from initializeReviewThreadCache() instead of re-parsing them
Comments suppressed due to low confidence (1)

src/github/pullRequestModel.ts:1453

  • While this refactoring improves code quality by eliminating duplicate comment parsing, it does not fully address issue #8445. The reported problem is that the "Refresh Pull Request Comments" command doesn't work. The command handler (in commands.ts line 2002) calls pullRequest.initializeReviewThreadCache() without awaiting it, and the changes in this PR don't modify the command handler. Additionally, to fully refresh comments, the command may need to call initializeReviewThreadCacheAndReviewComments() instead of just initializeReviewThreadCache(), to ensure both the thread cache and the comments property are updated. Consider updating the command handler as well to complete the fix for issue #8445.
	async initializeReviewThreadCacheAndReviewComments(): Promise<void> {
		const threads = await this.initializeReviewThreadCache();

		this.comments = threads.map(node => node.comments)
			.reduce((prev, curr) => prev.concat(curr), [])
			.sort((a: IComment, b: IComment) => {
				return a.createdAt > b.createdAt ? 1 : -1;
			});
	}

@alexr00 alexr00 merged commit d18dd77 into main Feb 4, 2026
12 checks passed
@alexr00 alexr00 deleted the alexr00/issue8445 branch February 4, 2026 10:44
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.

The "Refresh Pull Request Comments" command does not work.

3 participants