-
Notifications
You must be signed in to change notification settings - Fork 30.5k
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
Allow users to turn off automatic checking of extension updates #55087
Conversation
type: 'boolean', | ||
description: localize('extensionsAutoUpdate', "Automatically update extensions"), | ||
default: true, | ||
type: 'string', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ramya-rao-a This will break existing users settings file right? This will show a warning if the value is true
or false
.
May be we should support both types?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Supporting both types would make documenting this feature very confusing as false
doesnt really mean turn off checking for updates, it only means continue to check for updates but dont install them automatically
this.enabled = configValue !== 'checkAndInstall'; | ||
} else { | ||
this.enabled = configValue === 'checkAndInstall'; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May be you should start writing the enum value instead of boolean ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. I also removed the updateEnablement
check to keep this simple. There is already a check in place to add the right action to the secondary menu in the extensions view which is good enough.
} | ||
|
||
private eventuallySyncWithGallery(immediate = false): void { | ||
if (this.configurationService.getValue(AutoUpdateConfigurationKey) === 'off') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Name of this method is confusing with the new setting. This should be called checkForUpdatesAutomatically
@@ -414,6 +415,10 @@ export class ExtensionsWorkbenchService implements IExtensionsWorkbenchService, | |||
if (this.isAutoUpdateEnabled()) { | |||
this.checkForUpdates(); | |||
} | |||
if (!this.continuousSyncSetup && this.configurationService.getValue(AutoUpdateConfigurationKey) !== 'off') { | |||
this.continuousSyncSetup = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this variable needed ? If the value has changed you should either stop or start automatic checking?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the config setting changed to off
, then the loop for syncing is stopped. I added this to start the loop again. But on second thoughts, I can achieve the same without adding a new variable. I'll do that
@@ -452,7 +453,7 @@ export class ExtensionsViewlet extends ViewContainerViewlet implements IExtensio | |||
new Separator(), | |||
...(this.extensionManagementServerService.extensionManagementServers.length > 1 ? [this.groupByServerAction, new Separator()] : []), | |||
this.instantiationService.createInstance(CheckForUpdatesAction, CheckForUpdatesAction.ID, CheckForUpdatesAction.LABEL), | |||
...(this.configurationService.getValue(AutoUpdateConfigurationKey) ? [this.instantiationService.createInstance(DisableAutoUpdateAction, DisableAutoUpdateAction.ID, DisableAutoUpdateAction.LABEL)] : [this.instantiationService.createInstance(UpdateAllAction, UpdateAllAction.ID, UpdateAllAction.LABEL), this.instantiationService.createInstance(EnableAutoUpdateAction, EnableAutoUpdateAction.ID, EnableAutoUpdateAction.LABEL)]), | |||
...((autoUpdateConfigValue === true || autoUpdateConfigValue === 'checkAndInstall') ? [this.instantiationService.createInstance(DisableAutoUpdateAction, DisableAutoUpdateAction.ID, DisableAutoUpdateAction.LABEL)] : [this.instantiationService.createInstance(UpdateAllAction, UpdateAllAction.ID, UpdateAllAction.LABEL), this.instantiationService.createInstance(EnableAutoUpdateAction, EnableAutoUpdateAction.ID, EnableAutoUpdateAction.LABEL)]), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the issue with changing the type and we have to carry forward this knowledge for ever. May be we can expose this value from IExtensionWorkbenchService
and have only single place to know about this?
enumDescriptions: [ | ||
localize('extensionsAutoUpdateCheckAndInstall', "Install extension updates automatically in the background."), | ||
localize('extensionsAutoUpdateCheck', "Check for extension updates and mark extensions with available updates as outdated in the extensions view."), | ||
localize('extensionsAutoUpdateOff', "No checks are made automatically for extension updates. You can still manually check for updates using the `Extensions: Check for Updates` command.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How is "extensions.autoUpdate": "off"
implies that extension update checks will not be made? How about having a new setting extension.autoCheckUpdates
?
4ec110b
to
a6f5ca9
Compare
@sandy081 I've added a new setting to simplify things. |
This discussion reminds me of the discussion around
|
a6f5ca9
to
d8e4539
Compare
@Tyriar 2 reasons why overloading the existing setting is not a good idea from the user's prespective are
That is true. When |
@ramya-rao-a 👍 I'm convinced after reading this, as we want to discourage setting it to the "off" state. |
d8e4539
to
a6f5ca9
Compare
alright, then everyone here is on the same page :) Updated PR to reflect the changes to get the new setting. Over to you @sandy081 |
a6f5ca9
to
4520f55
Compare
@sandy081 The PR now reflects your suggestion of a new setting. I'll merge it now, as we would like to have it in the Monday's Insiders. Do take a look regardless and let me know if you have any other concerns. |
Thanks @ramya-rao-a for the changes |
Based on #54354 (comment) we abandoned the idea of a complete offline mode controlled by a single switch.
Instead, we are opting for all background features that do make a network request to be controlled via corresponding settings.
The extension update service is one such feature. This PR adds a new setting to control the extension update checks