Code-settings-sync: Can't download settings from public gist

Created on 26 Jan 2018  路  17Comments  路  Source: shanalikhan/code-settings-sync

Visual Studio Code Version : 1.19.2
Code Settings Sync Version : 2.8.7
Operating System : Windows 10 RS3
Occurs On: Downloda
Proxy Enabled: No
GIst Id: [ ID_HERE ]

@shanalikhan, to expand on my comment in #471, this common scenario does not work for me.

  1. On machine A, upload settings to a public gist.
  2. On machine B, reset settings.
  3. On machine B, download settings. It prompts for token, but none is needed because the gist is public. If I press Esc, it cancels out and does not download.

I even tried manually adding the public gist id in user settings json on machine B, but same result. How can I download settings successfully on machine B? Thanks

bug 馃悰

Most helpful comment

I agree. This is really frustrating. It's a great extension, but the configuration is not user-friendly. All I want to do is pull the settings from a public gist I created. Like wongjiahau, I don't want to create a new github token because the gist is already publicly visible. I tried pasting the URL of the github gist into the extension settings, as suggested by willingram, but I still get an error popping up when I attempt a to download. The error says to look at the developer tools console and when I do, it says "TypeError: Cannot read property 'gists' of null
at module.exports.t.GitHubService." This is a fresh install of VS Code. The only extension I've installed so far is Sync Settings. =/

All 17 comments

I will fix this in upcoming version.

can you verify setting sync.anonymousGist to true and then download the setting.

I can verify that setting anonymousGist to true allows you to download without token

however this is confusing, even more now that Github is deprecating anonymous gists

I think the wording should be modified since anonymous gists are no longer possible
https://blog.github.com/2018-02-18-deprecation-notice-removing-anonymous-gist-creation/

Thanks for providing information, i think i should remove the anonymousGist feature.
and change it with public gist

Released with v2.9
Let me know if there are issues

well.. i'm sorry to say @shanalikhan but we're having problems with this update

previously I had been able to download the settings WITHOUT generating a token, and without making the gist public

it was working just fine with a secret gist.. it was not anonymous.. but it was secret.. and it was possible for others to download from it without needing to make it public, and also more importantly without them needing to generate a token

now it seems a token is mandatory?

i know you need a token to make a gist, but why do you need one to download?

anyway my freelancer friend is unable to download now after I made the gist public and gave her the gist id.. it is forcing her to generate a token but a few days ago that wasn't the case

yea I just used Teamviewer to log in to my freelancer's computer and can confirm things are not working as they should

I created a public gist with my settings and gave her the gist id. Then from her computer I tried to goto Advanced Options -> Download from public gist and it prompted me for the gist id. I put it in and then it complained about invalid or expired token

then I actually had her create a token with her own github account, but the error is still there

I also tried to reset the extension settings but it didn't help

like I said above, a few days ago I was able to download from a secret gist (not to be confused with an anonymous gist) without creating a token or even logged into github.. but now this doesn't seem to work at all anymore

I feel like a new issue needs to be opened for this.. or at least this one re-opened

I am unable to transfer settings to another computer either.

Oh my goodness, this is so frustrating! I just wanted to download the settings I have from another laptop, is there a way that I can do without generating a Github Token?

Had the same issue, as a workaround you can paste the public GIST id directly into the Sync: Gist setting in the VS Code settings menu and perform the Sync: Download Settings actions as normal.

I agree. This is really frustrating. It's a great extension, but the configuration is not user-friendly. All I want to do is pull the settings from a public gist I created. Like wongjiahau, I don't want to create a new github token because the gist is already publicly visible. I tried pasting the URL of the github gist into the extension settings, as suggested by willingram, but I still get an error popping up when I attempt a to download. The error says to look at the developer tools console and when I do, it says "TypeError: Cannot read property 'gists' of null
at module.exports.t.GitHubService." This is a fresh install of VS Code. The only extension I've installed so far is Sync Settings. =/

Same as @robertmarriott here, what can we do @shanalikhan? Thanks :)

I was having the same issue but I got it working. After trying few things, I went back and I tried uploading the settings from my source machine and it gave me the information like below in output window in VSCode:
GitHub Token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx GitHub Gist: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx GitHub Gist Type: Secret

Now on my other machine, when asked for Token enter the token (GitHub Token above) and when it asks for Gist ID enter the Gist ID (GitHub Gist above). It works after that.

tpatel11 correctly pointed out that the gist has to be entered with the ID [only], and not the complete URL. The error went away after I did that, but I also had to enter my token.

Unfortunately, this extension uploaded the settings from my fresh install of VS Code and now my gist on github is completely overwritten. That wouldn't have happened if the extension allowed you to download the settings in read-only mode (i.e. by not forcing you to enter a token).

Update: I was able to restore my gist by re-uploading the settings from my other computer. I was then able to download the theme and plugins on my new computer via this extension; however, it didn't copy the settings.json from my gist. I had to manually copy and paste those settings over.

IMHO, this functionality should have been built into VS Code in the first place. It's unfortunate we need third-party extensions in order to share environment settings between workstations.

Same error here. Installed fresh vscode + settings sync and got:

TypeError: Cannot read property 'gists' of null
    at module.exports.t.GitHubService.<anonymous> (/home/gund/.vscode/extensions/shan.code-settings-sync-3.2.8/out/extension.js:419:31978)
    at Generator.next (<anonymous>)
    at module.exports.n (/home/gund/.vscode/extensions/shan.code-settings-sync-3.2.8/out/extension.js:419:30419)
    at new Promise (<anonymous>)
    at module.exports.n (/home/gund/.vscode/extensions/shan.code-settings-sync-3.2.8/out/extension.js:419:30196)
    at module.exports.t.GitHubService.ReadGist (/home/gund/.vscode/extensions/shan.code-settings-sync-3.2.8/out/extension.js:419:31920)
    at /home/gund/.vscode/extensions/shan.code-settings-sync-3.2.8/out/extension.js:130:81729
    at Generator.next (<anonymous>)
    at module.exports.n (/home/gund/.vscode/extensions/shan.code-settings-sync-3.2.8/out/extension.js:130:76170)
    at new Promise (<anonymous>)
    at module.exports.n (/home/gund/.vscode/extensions/shan.code-settings-sync-3.2.8/out/extension.js:130:75947)
    at /home/gund/.vscode/extensions/shan.code-settings-sync-3.2.8/out/extension.js:130:81490
    at module.exports.t.Sync.<anonymous> (/home/gund/.vscode/extensions/shan.code-settings-sync-3.2.8/out/extension.js:130:85259)
    at Generator.next (<anonymous>)
    at s (/home/gund/.vscode/extensions/shan.code-settings-sync-3.2.8/out/extension.js:130:76003)

Providing token does not work and neither public/anonymous gist!

_UPDATE_: I've found a way to overcome the issue!

All you have to do is:

  1. Reset settings sync from the command palette (IMPORTANT)
  2. Downgrade the version of extension to v3.2.7 (one patch before)
  3. Reload vscode once with that version
  4. Setup the plugin with tokens as usual

And after first install you can upgrade back to latest version!

P.S. Clearly the bug is in the latest patch of v3.2.8!

Version: 3.4.3 with macOS
uploads work properly but downloads work only with extensions and I can't download settings.json

same problem here too

Was this page helpful?
0 / 5 - 0 ratings

Related issues

UTexas80 picture UTexas80  路  5Comments

larrym picture larrym  路  4Comments

dagrooms52 picture dagrooms52  路  3Comments

mklement0 picture mklement0  路  5Comments

that70schris picture that70schris  路  5Comments