diff --git a/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts b/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts index 32215a48e46..452db88d105 100644 --- a/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts +++ b/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts @@ -2861,9 +2861,10 @@ export class ExtensionStatusAction extends ExtensionAction { this.updateStatus({ icon: warningIcon, message: markdown }, true); } if (this.extensionsWorkbenchService.isAutoUpdateDelayed(this.extension)) { + const delay = fromNow(Date.now() - this.extensionsWorkbenchService.getAutoUpdateDelay(), false, true); const updateAt = fromNow(Date.now() + this.extensionsWorkbenchService.getAutoUpdateDelayRemaining(this.extension), false, true); // Do not override the higher-priority warning class with the info class. - this.updateStatus({ icon: infoIcon, message: new MarkdownString(localize('autoUpdateDelayed', "This extension is not updated yet because new versions are auto updated 2 hours after they are published. It will be auto updated {0}.", updateAt)) }, !hasConsentWarning); + this.updateStatus({ icon: infoIcon, message: new MarkdownString(localize('autoUpdateDelayed', "This extension is not updated yet because new versions are auto updated {0} after they are published. It will be auto updated {1}.", delay, updateAt)) }, !hasConsentWarning); } } diff --git a/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts b/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts index 3c63d4fa3c8..a58d77d1291 100644 --- a/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts +++ b/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts @@ -1260,11 +1260,15 @@ export class ExtensionsWorkbenchService extends Disposable implements IExtension // Future timestamp (clock skew) — treat as not delayed return 0; } - const delayHours = this.configurationService.getValue(AutoUpdateDelayConfigurationKey) ?? 2; - const delayPeriod = delayHours * 60 * 60 * 1000; // Convert hours to milliseconds + const delayPeriod = this.getAutoUpdateDelay(); return Math.max(0, delayPeriod - elapsed); } + getAutoUpdateDelay(): number { + const delayHours = this.configurationService.getValue(AutoUpdateDelayConfigurationKey) ?? 2; + return delayHours * 60 * 60 * 1000; // Convert hours to milliseconds + } + private isFromTrustedPublisher(extension: IExtension): boolean { const trustedPublishers = this.productService.trustedExtensionPublishers; if (!trustedPublishers?.length) { diff --git a/src/vs/workbench/contrib/extensions/common/extensions.ts b/src/vs/workbench/contrib/extensions/common/extensions.ts index b102281d7f8..8357f20a07c 100644 --- a/src/vs/workbench/contrib/extensions/common/extensions.ts +++ b/src/vs/workbench/contrib/extensions/common/extensions.ts @@ -163,6 +163,7 @@ export interface IExtensionsWorkbenchService { getAutoUpdateValue(): AutoUpdateConfigurationValue; isAutoUpdateDelayed(extension: IExtension): boolean; getAutoUpdateDelayRemaining(extension: IExtension): number; + getAutoUpdateDelay(): number; checkForUpdates(): Promise; getExtensionRuntimeStatus(extension: IExtension): IExtensionRuntimeStatus | undefined; updateAll(): Promise;