SanderRonde / VSCode-Gerrit

Gerrit plugin for VSCode
https://marketplace.visualstudio.com/items?itemName=SanderRonde.vscode--gerrit
MIT License
31 stars 17 forks source link

Posted comments marked as Draft until Window reloaded #52

Closed FlipB closed 10 months ago

FlipB commented 10 months ago

When making comments in VS Code the comments are marked as "Draft". I would expect the "Draft" tag to be removed after hitting "Send" on the review.

As it is now, the comments are still shown as Draft in VS Code long after they have been posted to Gerrit.

"Gerrit: Refresh Changes" action does not help. After "Reload Window" action it does show the comment state correctly.

(however after a Window Reload action it shows the same comment thread duplicated 13 times (!) in VS Code, but clicking on the review in the Gerrit pane refreshes the comments which removes the duplicates)

SanderRonde commented 10 months ago

Thanks for the report! Should be fixed in the newest release (1.2.17)

FlipB commented 10 months ago

Quick turn-around! I tested 1.2.20 and when posting the comment it did indeed change and is no longer displayed as Draft. However, in it's place i got about 80 (!) instances of the same comment thread. Perhaps this is a different issue - should I create another issue?

In the logs i see a lot of calls to these two endpoint over and over again (575 consecutive lines)

GET request to "https://${gerritinstance}/changes/${change}/comments/" GET request to "https://${gerritinstance}/changes/${change}/drafts/"

SanderRonde commented 10 months ago

Ah yeah that sounds pretty bad. I'll just re-open this issue since my fix might have caused that. I'm assuming that you've censored the URLs you posted and they actually point to the same change right?

I'll try and get this fixed soon. For some reason I couldn't replicate the duplication issue before so I hope I can now. If not I might ask you for some more info/steps on how to reproduce.

FlipB commented 10 months ago

Yeah, I censored the URL's and apparently they didn't render correctly in github due to that. Updated the URLs. I'm using the Gerrit plugin via "Remote - SSH" plugin if that could affect things (to clarify Gerrit plugin is installed on the remote host, which is accessed via SSH).

SanderRonde commented 10 months ago

Ah yes thank you, that makes sense

SanderRonde commented 10 months ago

I think I've fixed the issue in the latest version. I'm not entirely sure since I can't replicate it so do let me know if it's still present!