The "Refresh Pull Request Comments" command does not work.#8473
Merged
Conversation
Contributor
There was a problem hiding this comment.
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 returnIReviewThread[]instead ofvoid, enabling reuse of the fetched threads - Refactored
initializeReviewThreadCacheAndReviewComments()to reuse threads frominitializeReviewThreadCache()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;
});
}
chrmarti
approved these changes
Feb 4, 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.
Fixes #8445