vscode-pull-request-github
vscode-pull-request-github copied to clipboard
Extension shows duplicate comments
- Extension version: 0.78.0
- VSCode Version: 1.85.1
- OS: Darwin x64 23.1.0
- Repository Clone Configuration: single repository
- Github Product: GitHub Enterprise Server 3.8.8
I am in the middle of reviewing a specific PR, and needed to restart VS Code. After restart, all of my comments in the PR are showing up duplicated (sometimes many, many times) and navigating conversations has become impossible. Here's an example of what I am seeing in the panel, where the same comment is shown over and over (and I definitely don't have 990 comments in this PR):
Yikes. Can you share a bit more about your workspace state?
- Do you recall if you had the PR checked out?
- Did you have the file with comment open when you restarted?
Hey @alexr00 thanks for the prompt reply.
Do you recall if you had the PR checked out?
I think I did have the PR checked out. When I want to review a PR I go through the "Checkout Pull Request by Number" workflow, which I presume checks out the PR locally:
This is the only way I've found to review a PR (and the only way I've found to exit a review is to checkout the main branch again.) If there is a way I can review specific PRs without having to alter my local state, I would be very interested to hear about it.
Did you have the file with comment open when you restarted?
I did not have the file open prior to starting the review. In fact, I didn't have any file in the review open. Also, I do not recall the comments downloading at all until I hit the "Refresh Pull Request Comments" button on the right side of the tab:
A few seconds later, all comments for all files are sync'd, but I see multiple instances of the same comment spread across the many files in this PR. I restarted several times and saw the same behavior each time. Admittedly, this PR is huge (~380 files) so I think the comment download is automatic, but just takes a while, and isn't in response to my hitting the refresh button. However, even after hitting the refresh button, the duplicated comments come back.
Thanks for the additional details!
If there is a way I can review specific PRs without having to alter my local state, I would be very interested to hear about it.
So long as you don't need to edit the PR files, you can review PRs from the "Pull Requests" view:
- If your PR doesn't show up in one of the exiting queries, use the pencil icon next to the query to edit the query. From there, follow the quick inputs to either modify the query or write a new one.
- Expand the PR tree node under the query
- You can now leave comments on files in that PR. You can open the PR description to complete your review.
@fosterbrereton I've tried the following:
- Create a big PR (almost 200 files)
- Leave a comment in one of the files
- Close all files
- Reload VS Code
- Open the comments view. At this point I can actually see my comment in the view, which already seems to be different from what you saw.
- Refresh the comments view.
I haven't gotten the many comments to appear. Do you recall how many comments the PR had? Have you seen this issue again?
So long as you don't need to edit the PR files, you can review PRs from the "Pull Requests" view:
@alexr00 this is amazing. So much faster than the GitHub UI when doing PR reviews, especially for ones with many files. Thank you for this tip!
In this "ephemeral" mode is different than the mode that populates the "Comments" tab at the bottom of the window, right? In other words, even when I am looking at a file using the steps you suggest, the "Comments" tab remains unchanged, populated with the comments from the current PR I have checked out. (I'm just making sure you're seeing the same thing I am seeing.) The "Comments" tab is the one where I am seeing the duplicated comments - not inline in the document alongside the code.
I haven't gotten the many comments to appear.
I am sorry my steps aren't reproducing the issue locally for you. Here are some more details about the specific PR that is giving me trouble:
- 326 files
- 250+ commits
- +24,041 −7,987 LOC
- ~100 comments
I realize this is an extreme case. I am not seeing the duplicated comments in other PRs that are smaller. I'll keep using the extension, and if I see another PR where this happens, I'll add more details here.
In this "ephemeral" mode is different than the mode that populates the "Comments" tab at the bottom of the window, right? In other words, even when I am looking at a file using the steps you suggest, the "Comments" tab remains unchanged, populated with the comments from the current PR I have checked out. (I'm just making sure you're seeing the same thing I am seeing.) The "Comments" tab is the one where I am seeing the duplicated comments - not inline in the document alongside the code.
You should see the following in the Comments view:
- The comments for the PR that you have checked out.
- The comments for any PR files that you have opened from the Pull Requests view.
- 326 files
- 250+ commits
- +24,041 −7,987 LOC
- ~100 comments
Thanks for the additional details! I'll see if I can repro with a PR that is more similar to that.
You should see the following in the Comments view:
- The comments for any PR files that you have opened from the Pull Requests view.
Related to this, I am seeing some strange behavior where when I click on a file in the Pull Requests view, it does show the comments for that file in the Comments tab. However, clicking on another file doesn't clear the comments from the previous file from that tab. I can even click on files from other pull requests, and they all show up in aggregate in the Comments view. Is that an intended behavior?
@fosterbrereton I was just discussing this with someone! Currently, what you describe is as designed, but it's poor design. We're thinking that the comments for a PR should clear when you have no tabs open that are part of that PR.
Issue: https://github.com/microsoft/vscode-pull-request-github/issues/5619
@alexr00 thank you for that bug report. I agree the behavior is unexpected.
As for the original issue, if the new information doesn't help in reproducing the issue on your end, I think we can close out the issue as cannot reproduce (-ish?). If I see it happen again in another branch, I'll update here.