question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Extension always asks to enable Force Upload

See original GitHub issue

I enabled just simple auto upload, but when I edit settings.json extension always says that version in Gist is newer and asks to enable force upload. изображение

BTW: VS Code language is english, so why the heck does it show up in Russian?

Enabling of Force Auto-upload works, but it’s a non-sense, I have only 1 single VS Code instance, and just installed the extension. Gist is saved by extension. lastUpload seems to be correct but it’s saved in UTC while I’m on a different time zone (+3).

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:20
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
karl-lunargcommented, Aug 29, 2019

lastUpload seems to be correct but it’s saved in UTC while I’m on a different time zone (+3).

I don’t think that this is the issue because the timestamps are in UTC in both the gist and local files.

It looks like the real problem is caused by faulty logic for the “safe upload” check.

As it stands, if there are multiple machines doing uploads, then any machine that did not do the last upload cannot upload unforced, even if it downloaded first. This essentially requires the use of forceUpload, which is bad.

Consider:

  • Machine A uploads settings to make revision 5 in the gist.
  • Later, Machine B downloads, makes a change, and (force) uploads settings to make revision 6 in the gist.
  • Later, Machine A downloads revision 6 and makes a change and tries to upload.

The upload fails because Machine A’s lastUpload has the timestamp of revision 5, and the gist is on revision 6. The current code considers the gist as “newer” if gistLastUpload >= localLastUpload.

Machine A’s lastDownload is for revision 6 and so it seems that the local lastDownload should be compared to the gist’s lastUpload to determine if the local machine has the latest gist content.

Indeed, this is what is seen in the “safe upload” issue proposal, but not in the current code.

So, I think you want to abort the upload if forceUpload is false and either of these is true:

  • localLastDownload is < gistLastUpload
  • none of the files have been changed (#316)

(I’m not sure if forceUpload overrides both of the above or not - but just keep it the way it is now.)

1reaction
shanalikhancommented, Sep 23, 2019

v3.4.3 Released. Let me know if there is any problem 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Extensions disabled by Chrome - Chrome Web Store Help
If you need to use a disabled extension, you can contact the extension's developer and ask them to upload their extension to the...
Read more >
Can you “force” VSCode extensions on your team's PC's?
Thing is, while this is an awesome extension, it actually ONLY really works when the ENTIRE team has it installed. If one person...
Read more >
Settings Sync in Visual Studio Code
Selecting the Sign in & Turn on button will ask you to choose between signing in ... You can always change what is...
Read more >
How to install and manage Azure CLI extensions
This article covers how to manage extensions and answers common questions about their use. How to find extensions. To see the Azure CLI ......
Read more >
Upload Edge extension to web store with existing extension ID
But that is not working in the Edge Store, it seems to always create a new extension ID. Is there a way to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found