microsoft / vscode-pull-request-github

GitHub Pull Requests for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=GitHub.vscode-pull-request-github
MIT License
2.32k stars 583 forks source link

Comment widget disappears after adding comment #3345

Open roblourens opened 2 years ago

roblourens commented 2 years ago

Testing microsoft/vscode#143545

Is this by design? If so, then the issue is that it doesn't disappear immediately, but after a delay. It is long enough for me to try to add a second reply to the thread, then the widget disappears while I am typing.

Recording 2022-02-23 at 11 14 49

alexr00 commented 2 years ago

@roblourens I can only reproduce when I have "githubPullRequests.commentExpandState": "collapseAll" set, and I think collapsing the comment is correct in this case.

I agree about the delay and I will remove it.

alexr00 commented 2 years ago

Looks like this isn't possible without new API to allow a comment to be created in a collapsed state.

roblourens commented 2 years ago

Oh yeah, I didn't realize I had a setting set for that

yhmtsai commented 1 year ago

Hi, I also face similar issue on github.dev. add a comment, and it will disappear after a few minutes without any collapsing action. It still shows on the github pull request page but it will not be in github.dev or vscode pull request view. comment_disapper the commentExpandState is expendUnresolved the pull request version is v0.64.0 on github.dev. vscode pull request also encounter the similar situation

alexr00 commented 1 year ago

@yhmtsai can you share the output of GitHub Pull Reques next time you see this issue?

yhmtsai commented 1 year ago

@alexr00 sure, the following is the output the comments disappears when 2023-05-26 16:37:42.517 info comes

2023-05-26 16:33:25.163 [info] PullRequestTree> Got all children for Files node
2023-05-26 16:33:26.463 [info] PullRequestTree> Review threads have changed, refreshing Files node
2023-05-26 16:33:26.464 [info] PullRequestTree> Review threads have changed, refreshing Commits node
2023-05-26 16:33:26.472 [info] PullRequestTree> Getting children for Files node
2023-05-26 16:33:26.477 [info] PullRequestTree> Got all children for Files node
2023-05-26 16:37:42.517 [info] PullRequestTree> Local files have changed, refreshing Files node
2023-05-26 16:37:42.530 [info] PullRequestTree> Getting children for Files node
2023-05-26 16:37:42.531 [info] PullRequestTree> Got all children for Files node
2023-05-26 16:37:46.655 [info] PullRequestTree> Comments have changed, refreshing Files node
2023-05-26 16:37:46.656 [info] PullRequestTree> Comments have changed, refreshing Commits node
2023-05-26 16:37:46.657 [info] PullRequestTree> Review threads have changed, refreshing Files node
2023-05-26 16:37:46.658 [info] PullRequestTree> Review threads have changed, refreshing Commits node
2023-05-26 16:37:46.714 [info] PullRequestTree> Getting children for Files node
2023-05-26 16:37:46.715 [info] PullRequestTree> Got all children for Files node
2023-05-26 16:37:46.829 [info] PullRequestTree> Getting children for Files node
2023-05-26 16:37:46.830 [info] PullRequestTree> Got all children for Files node
yhmtsai commented 1 year ago

from the behavior, it seems to submit the comments to the pull request without clicking commenting/approving/requesting changes. After the comments are submitted, it does not get the comments back to code.

alexr00 commented 1 year ago

Thanks @yhmtsai. I think you're correct, but I can't see why that would happen other then very unlucky timing, which you shouldn't see very often. Next time you see the issue, can you open the developer tools (command Developer: Toggle Developer Tools) and share the console?

yhmtsai commented 1 year ago

@alexr00 Sadly, it always happens on my side. Might it be related to the pull request size? It seems to only happen on the large pull request (+17119, -21, 73 files change, 524 comments there)

when the comments are disappeared, there's nothing shown in the console. github.dev does not have the Developer: Toggle Developer Tools, so I use vscode to do that. The extension is on WSL: ubuntu-22.04 and The version is v0.64.0 the following error is not shown when the comments are disappeared. Tf the file contains comments (not disappeared yet), click "go to review" or switch to another file and back and then show the error. (it doesn't always happen)

> [755] potential listener LEAK detected, having 215 listeners already. MOST frequent listener (25): event.ts:827
check   @   event.ts:827
l.l @   event.ts:966
f   @   menuService.ts:394
l.l @   event.ts:958
h   @   treeView.ts:1443
getResourceActions  @   treeView.ts:1415
renderElement   @   treeView.ts:1211
renderElement   @   asyncDataTree.ts:108
renderElement   @   abstractTree.ts:409
renderElement   @   listWidget.ts:1145
W   @   listView.ts:895
Q   @   listView.ts:636
splice  @   listView.ts:538
(anonymous) @   splice.ts:17
splice  @   splice.ts:17
(anonymous) @   listWidget.ts:1468
bufferEvents    @   event.ts:1373
splice  @   listWidget.ts:1468
splice  @   abstractTree.ts:1445
s   @   indexTreeModel.ts:306
splice  @   indexTreeModel.ts:157
l   @   objectTreeModel.ts:122
setChildren @   objectTreeModel.ts:71
setChildren @   objectTree.ts:56
I   @   asyncDataTree.ts:982
B   @   asyncDataTree.ts:743
await in B (async)      
z   @   asyncDataTree.ts:534
updateChildren  @   asyncDataTree.ts:520
(anonymous) @   treeView.ts:933
Gb  @   treeView.ts:933
refresh @   treeView.ts:863
$refresh    @   mainThreadTreeViews.ts:87
N   @   rpcProtocol.ts:455
M   @   rpcProtocol.ts:440
H   @   rpcProtocol.ts:370
G   @   rpcProtocol.ts:296
(anonymous) @   rpcProtocol.ts:161
invoke  @   event.ts:862
deliver @   event.ts:1075
fire    @   event.ts:1031
fire    @   ipc.net.ts:671
E   @   ipc.net.ts:1109
(anonymous) @   ipc.net.ts:955
invoke  @   event.ts:862
deliver @   event.ts:1075
fire    @   event.ts:1031
acceptChunk @   ipc.net.ts:415
(anonymous) @   ipc.net.ts:371
(anonymous) @   browserSocketFactory.ts:230
invoke  @   event.ts:862
deliver @   event.ts:1075
fire    @   event.ts:1031
i.onload    @   browserSocketFactory.ts:91

and

> Error event.ts:828
    at i.create (event.ts:841:25)
    at l.l [as onDidChange] (event.ts:965:25)
    at Object.f [as onWillAddFirstListener] (menuService.ts:394:34)
    at l.l [as onDidChange] (event.ts:958:20)
    at Te.h (treeView.ts:1443:24)
    at Te.getResourceActions (treeView.ts:1415:24)
    at Eu.renderElement (treeView.ts:1211:34)
    at d.renderElement (asyncDataTree.ts:108:17)
    at O.renderElement (abstractTree.ts:409:17)
    at H.renderElement (listWidget.ts:1145:13)
    at p.W (listView.ts:895:13)
    at p.Q (listView.ts:636:10)
    at p.splice (listView.ts:538:16)
    at splice.ts:17:35
    at Array.forEach (<anonymous>)
    at t.splice (splice.ts:17:20)
    at listWidget.ts:1468:57
    at m.bufferEvents (event.ts:1373:13)
    at Z.splice (listWidget.ts:1468:22)
    at Z.splice (abstractTree.ts:1445:9)
    at u.s (indexTreeModel.ts:306:14)
    at u.splice (indexTreeModel.ts:157:9)
    at R.l (objectTreeModel.ts:122:14)
    at R.setChildren (objectTreeModel.ts:71:8)
    at I.setChildren (objectTree.ts:56:14)
    at ke.I (asyncDataTree.ts:982:13)
    at ke.B (asyncDataTree.ts:743:8)
    at async ke.z (asyncDataTree.ts:534:3)
    at async ke.updateChildren (asyncDataTree.ts:520:3)
    at async Promise.all (index 1)
    at async e.CustomTreeView.Gb (treeView.ts:933:5)
alexr00 commented 1 year ago

@yhmtsai thank you for the additional details about the PR! It is the number of comments that is the problem. We only get the first 100 comments right now. I plan to address this in June: https://github.com/microsoft/vscode-pull-request-github/issues/4323

yhmtsai commented 1 year ago

@alexr00 I see, thanks you very much!

MetRonnie commented 4 days ago

I am still seeing this behaviour when adding comments to a PR that has >100 comments already. This is on v0.100.0