-
Notifications
You must be signed in to change notification settings - Fork 720
Description
- Extension version: 0.40.0
- VSCode Version: 1.66.2
- OS: Darwin arm64 21.4.0
Basically if you're working in multi-root workspace with at least two projects, each one on a branch with an open PR, and then switch one of those branches, the GitHub PR sidebar either breaks (shows errors when trying to submit review) or displays mismatched info (making it easy to leave a review/decision on a PR that you didn't mean to).
I have a minimal reproduction using public repositories that have test PRs open. I'm happy to add collaborators to these test repos if you don't want to recreate them yourself.
- Make sure the extension is installed
- Make a new directory,
cdinto it - Clone the following two public repos:
- Create a file called
workspace.code-workspacecontaining:
{
"folders": [
{
"path": "./issue-vscode-github-1"
},
{
"path": "./issue-vscode-github-2"
}
]
}- Use "Open workspace from file" from the command palette to open the workspace
- In source control, switch the first repo's branch to
fix-on-1with an open PR - In source control, switch the second repo's branch to
fix-on-2with an open PR
This is where the issues start. In particular the “GitHub Pull Request” sidebar has two panels, “Changes in pull request” and “Active pull request” which get mismatched depending on which actions are taken next:
- If you switch the second repo back to the main branch, the “Changes in pull request” incorrectly still includes changes for that branch, despite it not being checked out.
- If you switch the first repo back to the main branch, it will no longer show up in the “Changes in pull request” panel but it is still shown in the “Active pull request” panel despite it not being checked out.
At this point, due to the mismatched PRs, it becomes easy to leave a review or submit decisions for the wrong PRs (this has happened to me on more than one occasion). If you try to leave a review or take action on a PR for a branch that’s no longer checked out, you’ll get an error like the following:
Submitting review failed. Submitting review failed, no pending review for current pull request: 1.
This issue may be related to #3437. The only way I've managed to fix this is to either close and relaunch VS Code or to reload the VS Code window using the command palette.