-
-
Notifications
You must be signed in to change notification settings - Fork 394
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
Updating when nothing has changed #754
Comments
@ioprotium how about stopping on-change trigger for upload on the change of value As at the end What do you think about it ? |
@shanalikhan Yes, we should make a diff and determine whether the changes should be upload. Tomorrow I will look at this one! |
@ioprotium |
@shanalikhan we have a problem. VS doesn't supply a way to determine what changed in the file. The watcher is triggered only after the file was changed and saved to the system. So, if we need to determine if the changes must be upload we should compare the local file against the gist. This implies download the entire gist. Am I right? |
Yes, you are right. |
I've got another idea. Every time the upload action is triggered we can persist a copy without all the What do you think? Could you provide me the needed functions to create and read this "clean" settings file? |
Where you will persist the copy ? Do you have any ideas about that or you are looking to save the copy in
If you look here, I'm reading the files using this function and saving in a gist. https://github.com/shanalikhan/code-settings-sync/blob/master/src/sync.ts#L159 Here is the change detection event that will be hit on changing the https://github.com/shanalikhan/code-settings-sync/blob/master/src/commons.ts#L138 |
Tell me some folder that is isolated or it will not generate side effects and it should be always available for the extension (maybe created after installation, or the extension folder itself) |
https://code.visualstudio.com/api/references/vscode-api#ExtensionContext See here, you can persist the data in states provided by visual studio code api and read to compare. |
@ioprotium any update ? When you be able to complete ? |
same issue here. any update? |
Having the same issue as #553 |
Hi, sorry for the long delay. I've just sent the PR #867 |
* Fix #754 The pragma util keeps a copy of the settings that are upload to the gist. The file is located at <context.globalStoragePath>/settings.sync. If the content to be upload doesn't deffer from the local content after taking out the @sync-ignore, the file wont be uploaded. * Fix #754: Sync object Checks the global storage path at constructor. Checks if the content of the setting file should be uploaded. * Update tests * Fix #865 * Fix broken tests * Fixing Octokit wrong type for GistsResponse 'file' field is wrong with static data. * Defining PragmaUtil behavior Pragma util should only parse string content, checking each line for pragma statements. * Updating test for Pragma definition * Sync: don't upload is not necessary As the extension gets the entire gists before commiting an upload, we can check each file of the gists against our local files in order to determine if the content has changed. There is no need to keel a local copy.
🐛 Describe the bug
When you change a value of a setting property that has
// @sync-ignore
on it, it will still update. So if you do it a lot, you end up with a gist history like this...`@userName userName revised this gist 12 minutes ago. 1 changed file with 1 addition and 1 deletion.
2 cloudSettings
@@ -1 +1 @@
{"lastUpload":"2019-01-20T23:35:15.940Z","extensionVersion":"v3.2.4"} {"lastUpload":"2019-01-20T23:35:31.712Z","extensionVersion":"v3.2.4"}
@userName userName revised this gist 12 minutes ago. 1 changed file with 1 addition and 1 deletion.
2 cloudSettings
@@ -1 +1 @@
{"lastUpload":"2019-01-20T23:35:04.064Z","extensionVersion":"v3.2.4"} {"lastUpload":"2019-01-20T23:35:15.940Z","extensionVersion":"v3.2.4"}
@userName userName revised this gist 12 minutes ago. 1 changed file with 1 addition and 1 deletion.
2 cloudSettings
@@ -1 +1 @@
{"lastUpload":"2019-01-20T23:35:00.152Z","extensionVersion":"v3.2.4"} {"lastUpload":"2019-01-20T23:35:04.064Z","extensionVersion":"v3.2.4"}
@userName userName revised this gist 12 minutes ago. 1 changed file with 1 addition and 1 deletion.
2 cloudSettings
@@ -1 +1 @@
{"lastUpload":"2019-01-20T23:34:56.838Z","extensionVersion":"v3.2.4"} {"lastUpload":"2019-01-20T23:35:00.152Z","extensionVersion":"v3.2.4"}
@userName userName revised this gist 12 minutes ago. 1 changed file with 1 addition and 1 deletion.
`
The only change that is being uploaded is a change to date/time. I change my ignored setting dozens of times per day, so my Gist log looks crazy. It's a lot of unnecessary uploading. Could you make it so the anything with a
// @sync-ignore
doesn't trigger an upload? Thank you very much for this awesome tool.The text was updated successfully, but these errors were encountered: