Vscode-pull-request-github: Seeing duplicate review comments appearing

Created on 15 Sep 2020  路  14Comments  路  Source: microsoft/vscode-pull-request-github

I am using the nightly PR extension in web selfhost and often comments appear multiple times:

image

Looks like maybe comments are not disposed properly? Could also be a VSCode issue.

//cc @alexr00

bug

Most helpful comment

I was able to reproduce this consistently by switching between these two views.

  • Created by me and
  • All
    Screenshot 2020-10-20 at 14 15 17

I created the gif below to illustrate how. I select the PR under the Created by me section, go the file I know has a comment. Go to a different file in that PR and then go the All section, select the same PR and go the file I know has a comment and then there is a duplicate.

githubprbug

P.S I really wanted to have a go at fixing this for Hackoberfest but I can't seem to get tests running locally. Cheers!

All 14 comments

@bpasero do you remember exactly where you opened that diff from (which view)?

Got it to repro.

Btw I think I see this in desktop too.

@bpasero I haven't changed anything, but now I cannot repro the issue. It happened pretty reliably before. Are you still seeing it?

True, seems better today. I will keep an eye open.

@alexr00 happened again today:

image

Just +1 that I see this happen a lot and it would be nice if it got fixed. Might try to take a stab at it for Hackokberfest :)

Could have the same root cause. I also see duplicate comments in the Comments view

image

@RMacfarlane FYI in case you have any ideas here. I haven't gotten a consistent repro to figure out what's going on.

I was able to reproduce this consistently by switching between these two views.

  • Created by me and
  • All
    Screenshot 2020-10-20 at 14 15 17

I created the gif below to illustrate how. I select the PR under the Created by me section, go the file I know has a comment. Go to a different file in that PR and then go the All section, select the same PR and go the file I know has a comment and then there is a duplicate.

githubprbug

P.S I really wanted to have a go at fixing this for Hackoberfest but I can't seem to get tests running locally. Cheers!

@RMacfarlane I found the problem, but as far as I can see I would need to rewrite the entire Pull Requests tree to fix it.

The issue arises from the fact that a PR can appear in the tree more than once (for example once in Created By Me and once in All). When this happens, a PRNode that handles adding comment threads to documents gets created for each time the PR appears in the tree. So when a file that appears in both PRNodes is opened, both PRNodes add a comment thread.

On the surface this seemed like a simple fix: just only create one PRNode. However, the tree API (correctly) doesn't allow you to add the same item to the tree twice. Ok. Then we just separate the tree portion of PRNode from the comment handling portion. I started this, but it is several days of work, since the tree/comment/pr portions of all the tree elements are totally intertwined.

If you see a better solution then that is a relief. I don't want to move all your furniture around, so I've assigned to you. If you won't be able to get around to this in the next month or so, I can figure out how the comment related code in here works and plan time for the refactor.

Is it possible that there's more than one cause for this? I am using only a single "instance" of a particular PR in the tree view, navigating around and commenting, and I'm finding the comments are duplicating

image

In my case I am using the "review mode" where the comments are all pending until the review is submitted, which could be relevant.

I'm using version 0.23.1 of the extension.

The duplicates are getting out of hand 馃槶

duplicates

Is there any way this is getting solved? For me this is a killer bug, making whole plugin practically unusable. Constant milestone pushback does not seem to be very promising

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Velyks picture Velyks  路  3Comments

RamonMeffert picture RamonMeffert  路  3Comments

scrossan-crown picture scrossan-crown  路  4Comments

sbatten picture sbatten  路  4Comments

Tyriar picture Tyriar  路  4Comments