Skip to content

Commit a162dff

Browse files
committed
Fix web extensions breaking when the commit changes
By just using the marketplace directly instead of going through the backend. I am not sure what the point is when searching extensions already goes directly to the marketplace anyway.
1 parent 6ba153f commit a162dff

7 files changed

+22
-20
lines changed

patches/display-language.diff

+1-1
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
199199

200200
const workbenchWebConfiguration = {
201201
remoteAuthority,
202-
@@ -345,6 +348,7 @@ export class WebClientServer {
202+
@@ -338,6 +341,7 @@ export class WebClientServer {
203203
WORKBENCH_NLS_BASE_URL: vscodeBase + (nlsBaseUrl ? `${nlsBaseUrl}${this._productService.commit}/${this._productService.version}/` : ''),
204204
BASE: base,
205205
VS_BASE: vscodeBase,

patches/logout.diff

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
4646
updateEndpoint: !this._environmentService.args['disable-update-check'] ? base + '/update/check' : undefined,
4747
+ logoutEndpoint: this._environmentService.args['auth'] ? base + '/logout' : undefined,
4848
embedderIdentifier: 'server-distro',
49-
extensionsGallery: {
50-
...this._productService.extensionsGallery,
49+
extensionsGallery: this._productService.extensionsGallery,
50+
},
5151
Index: code-server/lib/vscode/src/vs/workbench/browser/client.ts
5252
===================================================================
5353
--- code-server.orig/lib/vscode/src/vs/workbench/browser/client.ts

patches/marketplace.diff

+11-9
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ Add Open VSX default and an env var for marketplace, fix old marketplace
33
Our old marketplace only supports `serviceUrl` but this causes the marketplace
44
to be disabled entirely so this moves the template var check to fix that.
55

6+
This also removes serverRootPath from the web extension route because that will
7+
include the commit. When you update code-server the web extension will continue
8+
using this path since it is stored in the browser but the path will 404 because
9+
the commit no longer matches.
10+
611
This can be tested by setting EXTENSIONS_GALLERY set to:
712

813
'{"serviceUrl": "https://extensions.coder.com/api"}'
@@ -32,22 +37,19 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
3237
===================================================================
3338
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
3439
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
35-
@@ -308,14 +308,14 @@ export class WebClientServer {
40+
@@ -308,14 +308,7 @@ export class WebClientServer {
3641
codeServerVersion: this._productService.codeServerVersion,
3742
rootEndpoint: base,
3843
embedderIdentifier: 'server-distro',
3944
- extensionsGallery: this._webExtensionResourceUrlTemplate ? {
40-
+ extensionsGallery: {
41-
...this._productService.extensionsGallery,
45+
- ...this._productService.extensionsGallery,
4246
- 'resourceUrlTemplate': this._webExtensionResourceUrlTemplate.with({
43-
+ 'resourceUrlTemplate': this._webExtensionResourceUrlTemplate ? this._webExtensionResourceUrlTemplate.with({
44-
scheme: 'http',
45-
authority: remoteAuthority,
46-
path: `${this._webExtensionRoute}/${this._webExtensionResourceUrlTemplate.authority}${this._webExtensionResourceUrlTemplate.path}`
47+
- scheme: 'http',
48+
- authority: remoteAuthority,
49+
- path: `${this._webExtensionRoute}/${this._webExtensionResourceUrlTemplate.authority}${this._webExtensionResourceUrlTemplate.path}`
4750
- }).toString(true)
4851
- } : undefined
49-
+ }).toString(true) : undefined
50-
+ }
52+
+ extensionsGallery: this._productService.extensionsGallery,
5153
},
5254
callbackRoute: this._callbackRoute
5355
};

patches/proxy-uri.diff

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
7474
logoutEndpoint: this._environmentService.args['auth'] ? base + '/logout' : undefined,
7575
+ proxyEndpointTemplate: base + '/proxy/{{port}}',
7676
embedderIdentifier: 'server-distro',
77-
extensionsGallery: {
78-
...this._productService.extensionsGallery,
77+
extensionsGallery: this._productService.extensionsGallery,
78+
},
7979
Index: code-server/lib/vscode/src/vs/workbench/browser/web.main.ts
8080
===================================================================
8181
--- code-server.orig/lib/vscode/src/vs/workbench/browser/web.main.ts

patches/service-worker.diff

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
3030
+ path: base + '/_static/out/browser/serviceWorker.js',
3131
+ },
3232
embedderIdentifier: 'server-distro',
33-
extensionsGallery: {
34-
...this._productService.extensionsGallery,
33+
extensionsGallery: this._productService.extensionsGallery,
34+
},
3535
Index: code-server/lib/vscode/src/vs/workbench/browser/client.ts
3636
===================================================================
3737
--- code-server.orig/lib/vscode/src/vs/workbench/browser/client.ts

patches/telemetry.diff

+2-2
Original file line numberDiff line numberDiff line change
@@ -208,5 +208,5 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
208208
},
209209
+ enableTelemetry: this._productService.enableTelemetry,
210210
embedderIdentifier: 'server-distro',
211-
extensionsGallery: {
212-
...this._productService.extensionsGallery,
211+
extensionsGallery: this._productService.extensionsGallery,
212+
},

patches/update-check.diff

+2-2
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
111111
rootEndpoint: base,
112112
+ updateEndpoint: !this._environmentService.args['disable-update-check'] ? base + '/update/check' : undefined,
113113
embedderIdentifier: 'server-distro',
114-
extensionsGallery: {
115-
...this._productService.extensionsGallery,
114+
extensionsGallery: this._productService.extensionsGallery,
115+
},
116116
Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
117117
===================================================================
118118
--- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts

0 commit comments

Comments
 (0)