Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 26 additions & 7 deletions patches/11-update-use-github-release.patch
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,20 @@ index 1afbb0d3..87c877fd 100644
+ | "user";
\ No newline at end of file
diff --git a/src/vs/platform/update/electron-main/abstractUpdateService.ts b/src/vs/platform/update/electron-main/abstractUpdateService.ts
index 09971caf..92552866 100644
index 09971caf..9ae70a23 100644
--- a/src/vs/platform/update/electron-main/abstractUpdateService.ts
+++ b/src/vs/platform/update/electron-main/abstractUpdateService.ts
@@ -19,3 +19,3 @@ import { ILogService } from '../../log/common/log.js';
import { IProductService } from '../../product/common/productService.js';
-import { IRequestService } from '../../request/common/request.js';
+import { asJson, IRequestService, NO_FETCH_TELEMETRY } from '../../request/common/request.js';
import { StorageScope, StorageTarget } from '../../storage/common/storage.js';
@@ -23,3 +23,4 @@ import { IApplicationStorageMainService } from '../../storage/electron-main/stor
@@ -23,3 +23,3 @@ import { IApplicationStorageMainService } from '../../storage/electron-main/stor
import { ITelemetryService } from '../../telemetry/common/telemetry.js';
-import { AvailableForDownload, DisablementReason, IUpdateService, State, StateType, UpdateType } from '../common/update.js';
+import { Architecture, AvailableForDownload, DisablementReason, IUpdate, IUpdateService, Platform, State, StateType, Target, UpdateType } from '../common/update.js';
+import * as semver from 'semver';

@@ -32,12 +33,8 @@ export interface IUpdateURLOptions {
@@ -32,12 +32,8 @@ export interface IUpdateURLOptions {

-export function createUpdateURL(baseUpdateUrl: string, platform: string, quality: string, commit: string, options?: IUpdateURLOptions): string {
- const url = new URL(`${baseUpdateUrl}/api/update/${platform}/${quality}/${commit}`);
Expand All @@ -81,12 +80,32 @@ index 09971caf..92552866 100644
-
- return url.toString();
}
@@ -535,3 +532,3 @@ export abstract class AbstractUpdateService extends Disposable implements IUpdat
@@ -98,2 +94,19 @@ function isCancellableState(type: StateType): boolean {

+// Dotted-numeric version compare (release versions only — no prerelease or
+// build-metadata handling needed for the normalized x.y.z strings compared
+// below). Local so the packaged main process doesn't need the `semver`
+// package, which is no longer in upstream's production dependency tree.
+function compareVersions(a: string, b: string): number {
+ const pa = a.split('-')[0].split('.').map(Number);
+ const pb = b.split('-')[0].split('.').map(Number);
+ for (let i = 0; i < Math.max(pa.length, pb.length); i++) {
+ const na = pa[i] ?? 0;
+ const nb = pb[i] ?? 0;
+ if (na !== nb) {
+ return na < nb ? -1 : 1;
+ }
+ }
+ return 0;
+}
+
export abstract class AbstractUpdateService extends Disposable implements IUpdateService {
@@ -535,3 +548,3 @@ export abstract class AbstractUpdateService extends Disposable implements IUpdat

- if (mode === 'none') {
+ if (mode === 'none' || mode === 'manual') {
return undefined;
@@ -545,17 +542,37 @@ export abstract class AbstractUpdateService extends Disposable implements IUpdat
@@ -545,17 +558,37 @@ export abstract class AbstractUpdateService extends Disposable implements IUpdat

+ return this._isLatestVersion(url, false)
+ .then((result) => {
Expand Down Expand Up @@ -131,7 +150,7 @@ index 09971caf..92552866 100644
+
+ this.logService.info('update#isLatestVersion() - found version', fetchedVersion, currentVersion);
+
+ const lastest = semver.compareBuild(currentVersion, fetchedVersion) >= 0;
+ const lastest = compareVersions(currentVersion, fetchedVersion) >= 0;
+
+ return Promise.resolve({ lastest, update });
+ })
Expand Down
Loading