Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating comment failed: TypeError: Cannot read properties of null (reading 'id') #3504

Closed
ssardina opened this issue Apr 30, 2022 · 11 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Milestone

Comments

@ssardina
Copy link

  • Extension version: 0.40.0
  • VSCode Version: 1.66.2
  • OS: Linux on remote server mode (editing a repo on another machine)

Steps to Reproduce:

On a multi-repo workspace:

  1. Open PR for repo A and issue a comment; works and is saved.
  2. Open a second repo B
  3. Issue a comment for repo B; will fail and not be saved

Works once you restart Vscode and edit the PR of B directly, but once you open another repo C, same problem.

However, when it works (for the first repo), Vscode does not bring up that pop-up selection box GitHub Pull Request http://gitbub.com when clicking +; I suspect extension gets confused and tries to do a comment somewhere else and has no permission

Expected: The comment is saved

Actual result:

ghpr-problem

image

@alexr00 alexr00 self-assigned this May 3, 2022
@alexr00 alexr00 added the bug Issue identified by VS Code Team member as probable bug label May 3, 2022
@alexr00 alexr00 added this to the May 2022 milestone May 3, 2022
@alexr00
Copy link
Member

alexr00 commented Jun 1, 2022

@ssardina do you have PRs checked out for one or both of these repos or are you just leaving comments by oping the diffs from the "Pull Requests" view?

@alexr00 alexr00 added the info-needed Issue requires more information from poster label Jun 1, 2022
@alexr00 alexr00 removed this from the May 2022 milestone Jun 1, 2022
@ssardina
Copy link
Author

ssardina commented Jun 1, 2022

@alexr00 , well I do have PRs for each of the repos A and B, yes. And I am doing comments on the diffs in the "Pull Requests" view.

This is what happens when I hit SAVE for a comment:

image

As soon as I hit + to add a comment on the diff, sometimes it asks me for this and sometimes not:

image

When it does, then I get the above behavior and error. When it doesn't ask me, I can enter the comment and save it without the error window coming up below, but the comment stays as Pending and is never pushed:

image

Hope it helps...

@alexr00
Copy link
Member

alexr00 commented Jun 2, 2022

Thanks @ssardina it does help. I can't reproduce it, but I'm wondering if you might have the same remote with different names setup in one or more of your repository clones.

A few more questions to help determine this:

  • Do you have one folder open in VS Code that has multiple repositories clones in the folder?
  • Can you share the output of git remote -v for each of your repository clones?

@ssardina
Copy link
Author

ssardina commented Jun 2, 2022

mm difficult one indeed. I have many repos, each on its folder. All repos are in an GitHub organization (for a course). Here are the remote -v for two of them:

image

Yes one folder open in VS Code, the root of all submissions. There is then 1 folder per submission, each having its own repo, yes!

@alexr00
Copy link
Member

alexr00 commented Jun 3, 2022

I can reproduce it, but only if I have two clones of the same repo. Example folder structure:

Folder "alexr00" - this is the folder I have open in VS Code.
  Folder "playground" - Contains a clone of my repository alexr00/playground
  Folder "playground-2" - Contains a clone of my repository alexr00/playground

@ssardina is it possible you have a similar duplication in your open folder?

@ssardina
Copy link
Author

ssardina commented Jun 6, 2022

Hi @alexr00 , thanks for following this up.

Actually, no, they are different repos as you can see from the screenshot above:

image

They do come from the same git template repo, but they are technically different repos. mm strange..

@alexr00
Copy link
Member

alexr00 commented Jun 7, 2022

I will see if I can fix the issue with two clones of the same repo and maybe it will fix the issue you're seeing too.

@alexr00 alexr00 added this to the June 2022 milestone Jun 7, 2022
@ssardina
Copy link
Author

ssardina commented Jun 7, 2022

It's a good idea/strategy, that is an issue as well anyways that you found! :-) Thanks!

@alexr00 alexr00 removed the info-needed Issue requires more information from poster label Jun 29, 2022
alexr00 added a commit that referenced this issue Jun 30, 2022
@alexr00 alexr00 modified the milestones: June 2022, July 2022 Jun 30, 2022
alexr00 added a commit that referenced this issue Jul 6, 2022
@alexr00
Copy link
Member

alexr00 commented Jul 11, 2022

@ssardina the pre-release build has my fix for the double repo issue, which I think will also fix your issue. If you are able to try out the pre-release build and comment about whether the issue is fixed that would be very helpful!

There are still other bugs with multi repo support, tracked here: #3490

@alexr00
Copy link
Member

alexr00 commented Jul 12, 2022

I'm going to close the issue so that it gets tracked for verification before the next release. @ssardina if you still see the issue I will reopen it!

@alexr00 alexr00 closed this as completed Jul 12, 2022
@ssardina
Copy link
Author

Will do @alexr00, thanks!

@connor4312 connor4312 added the verified Verification succeeded label Jul 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

3 participants