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

Git Graph View fails to resume when switching back from a file #301

Closed
mirkadev opened this issue Apr 25, 2020 · 3 comments
Closed

Git Graph View fails to resume when switching back from a file #301

mirkadev opened this issue Apr 25, 2020 · 3 comments
Assignees
Labels
vscode-bug Something isn't working in Visual Studio Code, that affects Git Graph and all other extensions.

Comments

@mirkadev
Copy link

mirkadev commented Apr 25, 2020

Describe the Bug
The extension is crushed after switching to other file tab and return back to the extension tab.

Steps to Reproduce
Steps to reproduce the behaviour:

  1. Go to the extension page
  2. Open any file from a project
  3. Return to the extension tab
  4. See error

Expected Behaviour
Error is absent.

Environment

  • Git Graph Extension Version: 1.22.0
  • Visual Studio Code Version: 1.44.2
  • Operating System: Elementary OS (Ubuntu 18.04.3)

Screenshots (optional)
image

@mirkadev mirkadev added the bug Something isn't working label Apr 25, 2020
@mirkadev mirkadev changed the title Crashed Git Graph Crushed Git Graph Apr 25, 2020
@mhutchie
Copy link
Owner

Hi @lmjavascriptprogrammer,

Thanks for reporting this bug! I haven’t been able to replicate the behaviour you’re observing (by following your steps), and none of the other ~400,000 users of the extension have ever reported anything similar to this. If it were a bug caused by Git Graph itself, heaps of users would have reported it (as the steps you’ve described are quite a common use case). My best guess is that it is likely an isolated bug caused by Visual Studio Code on your specific Operating System.

Could you please include a screenshot of the full width of the error? (it looks like you’ve cropped off the left of it, which appears to be included imported information)

Also, could you include a screenshot of the Developer Tools Console View? (open it by running the “Developer: Open Webview Developer Tools” from the Visual Studio Code Command Palette once the Git Graph View is visible and showing the error)

Does this error occur every time you follow the steps you’ve provided, or does it occur just some of the time?

@mhutchie mhutchie added the needs more info More information has been requested label Apr 25, 2020
@mhutchie mhutchie changed the title Crushed Git Graph Git Graph View fails to resume when switching back from a file Apr 25, 2020
@mirkadev
Copy link
Author

mirkadev commented Apr 27, 2020

Hi @mhutchie,

Thanks for your answer. I'm sorry, I really provided incomplete information about the bug. So, I get the error only one my huge git project >150 branches. I had to crop some info as it's sensitive information. I started getting this error after the last update VSCode, but I'm not sure if it's related.

Big thanks for your extension. I really love it.

Include screenshot.

image

@mhutchie mhutchie removed the needs more info More information has been requested label Apr 27, 2020
@mhutchie
Copy link
Owner

Hi @lmjavascriptprogrammer, Thanks for the additional information!

Although it only appears to be a problem on your large git repository, I've extensively tested Git Graph on much larger repositories and it has functioned perfectly. Considering there are so many users of the extension, if there was a limitation on the size of repositories it could handle I'm almost certain at least one other user would have reported it by now.


  • The Content Security Policy 'default-src 'none'; style-src vscode-resource: 'unsafe-inline'; script-src vscode-resource: 'nonce-toilwMutic7WkNmokWSRTYduylIiMvvZ'; img-src data:;' was delivered via a <meta> element outside the document's <head>, which is disallowed. The policy has been ignored.
  • Uncaught ReferenceError: acquireVsCodeApi is not defined

Both of these errors are indicative of a bug introduced in the last Visual Studio Code update (more information below). This also seems highly likely considering you're only getting these errors after updating Visual Studio Code.

  • The Content Security Policy 'default-src 'none'; style-src vscode-resource: 'unsafe-inline'; script-src vscode-resource: 'nonce-toilwMutic7WkNmokWSRTYduylIiMvvZ'; img-src data:;' was delivered via a <meta> element outside the document's <head>, which is disallowed. The policy has been ignored.

This error prevents Git Graph from loading the required JavaScript and CSS resources for the Git Graph View. As you can see in the code here, the meta element is definitely defined within the documents <head> within a string literal. If there was an underlying problem with how I construct this string, every user of the extension would be unable to load the Git Graph View.

  • Uncaught ReferenceError: acquireVsCodeApi is not defined

acquireVsCodeApi is a method that Visual Studio Code makes available to the JavaScript contents of the Webview (which the Git Graph View uses). If it's not defined, the Git Graph View cannot communicate with the Git Graph Extension (required for data transfer, events, and state persistence). The fact that it is not defined indicates that Visual Studio Code is erroneously not providing it to the Webview contents, preventing the Git Graph View from correctly loading.


Based on all of the available information I have, this bug is almost certainly caused by a bug introduced in the latest Visual Studio Code release. Please raise it as a bug in the vscode repo, so Microsoft can fix it.

I'll close this bug for now as it appears not to be caused by Git Graph (however if information to the contrary is discovered, I'll definitely re-open and fix it accordingly).

@mhutchie mhutchie added vscode-bug Something isn't working in Visual Studio Code, that affects Git Graph and all other extensions. and removed bug Something isn't working labels Jun 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
vscode-bug Something isn't working in Visual Studio Code, that affects Git Graph and all other extensions.
Projects
None yet
Development

No branches or pull requests

2 participants