Skip to content

Commit 5395539

Browse files
fix: rewrite openreplay patch for correct line numbers and move to end of series
- Fixed webClientServer.ts hunks to target the correct lines in the original vscode file (workbenchWebConfiguration at line 368, values at line 385) - Moved openreplay.diff to end of series to avoid breaking downstream patches that also modify client.ts (like insecure-notification.diff) - All 25 patches now apply successfully
1 parent c36d9b8 commit 5395539

File tree

2 files changed

+20
-27
lines changed

2 files changed

+20
-27
lines changed

patches/openreplay.diff

Lines changed: 19 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -133,34 +133,27 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
133133
===================================================================
134134
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
135135
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
136-
@@ -304,6 +304,10 @@ export class WebClientServer {
137-
const workbenchWebConfiguration: IWorkbenchConstructionOptions & { settingsSyncOptions?: ISettingsSyncOptions } = {
138-
remoteAuthority,
139-
webviewEndpoint: this._staticRoute + this._webviewEndpoint,
136+
@@ -368,5 +368,9 @@ export class WebClientServer {
137+
folderUri: resolveWorkspaceURI(this._environmentService.args['default-folder']),
138+
workspaceUri: resolveWorkspaceURI(this._environmentService.args['default-workspace']),
139+
productConfiguration,
140+
- callbackRoute: callbackRoute
141+
+ callbackRoute: callbackRoute,
140142
+ // OpenReplay configuration - passed to HTML template
141143
+ openReplayProjectKey: process.env.OPENREPLAY_PROJECT_KEY || '',
142-
+ openReplayUserEmail: process.env.JUPYTERHUB_USER || process.env.USER_EMAIL || '',
144+
+ openReplayUserEmail: process.env.JUPYTERHUB_USER || process.env.USER_EMAIL || ''
143145
+ // End OpenReplay configuration
144-
_wrapWebWorkerExtHostInIframe,
145-
developmentOptions: { enableSmokeTestDriver: this._environmentService.args['enable-smoke-test-driver'] ? true : undefined, logLevel: this._logService.getLevel() },
146-
settingsSyncOptions: !this._environmentService.isBuilt && this._environmentService.args['enable-sync'] ? { enabled: true } : undefined,
147-
@@ -384,6 +388,8 @@ export class WebClientServer {
148-
149-
let data;
150-
if (!this._environmentService.isBuilt) {
151-
+ data = data.replace(/{{OPENREPLAY_PROJECT_KEY}}/g, workbenchWebConfiguration.openReplayProjectKey || '');
152-
+ data = data.replace(/{{OPENREPLAY_USER_EMAIL}}/g, workbenchWebConfiguration.openReplayUserEmail || '');
153-
data = data.replace('{{WORKBENCH_WEB_BASE_URL}}', this._staticRoute);
154-
data = data.replace('{{WORKBENCH_NLS_BASE_URL}}', nlsBaseUrl ? `${nlsBaseUrl}${!nlsBaseUrl.endsWith('/') ? '/' : ''}${this._productService.commit}/${this._productService.version}/` : '');
155-
data = data.replace('{{WORKBENCH_NLS_FALLBACK_URL}}', '');
156-
@@ -414,6 +420,10 @@ export class WebClientServer {
157-
values[`{{${key}}}`] = String(nlsConfiguration[key as keyof typeof nlsConfiguration]);
158-
}
146+
};
159147

148+
const cookies = cookie.parse(req.headers.cookie || '');
149+
@@ -385,6 +389,9 @@ export class WebClientServer {
150+
WORKBENCH_WEB_CONFIGURATION: asJSON(workbenchWebConfiguration),
151+
WORKBENCH_AUTH_SESSION: authSessionInfo ? asJSON(authSessionInfo) : '',
152+
WORKBENCH_WEB_BASE_URL: staticRoute,
153+
WORKBENCH_NLS_URL,
154+
- WORKBENCH_NLS_FALLBACK_URL: `${staticRoute}/out/nls.messages.js`
155+
+ WORKBENCH_NLS_FALLBACK_URL: `${staticRoute}/out/nls.messages.js`,
160156
+ // OpenReplay configuration
161-
+ values['{{OPENREPLAY_PROJECT_KEY}}'] = workbenchWebConfiguration.openReplayProjectKey || '';
162-
+ values['{{OPENREPLAY_USER_EMAIL}}'] = workbenchWebConfiguration.openReplayUserEmail || '';
163-
+
164-
let newData = data;
165-
for (const key in values) {
166-
newData = newData.replace(new RegExp(escapeRegExpCharacters(key), 'g'), values[key]);
157+
+ OPENREPLAY_PROJECT_KEY: process.env.OPENREPLAY_PROJECT_KEY || '',
158+
+ OPENREPLAY_USER_EMAIL: process.env.JUPYTERHUB_USER || process.env.USER_EMAIL || ''
159+
};

patches/series

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
integration.diff
2-
openreplay.diff
32
base-path.diff
43
proposed-api.diff
54
marketplace.diff
@@ -23,3 +22,4 @@ clipboard.diff
2322
display-language.diff
2423
trusted-domains.diff
2524
signature-verification.diff
25+
openreplay.diff

0 commit comments

Comments
 (0)