Skip to content

Commit

Permalink
Updating to latest fallgback versio
Browse files Browse the repository at this point in the history
  • Loading branch information
vidorteg committed Sep 16, 2024
1 parent fd9e351 commit 81b5615
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 14 deletions.
8 changes: 4 additions & 4 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,25 @@
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"autoAttachChildProcesses": true,
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
"stopOnEntry": false,
"sourceMaps": true,
"outFiles": [
"${workspaceFolder}/out/**/*.js"
],
"preLaunchTask": "npm: build"
"preLaunchTask": "npm: build-debug"
},
{
"name": "Launch Extension Edge Watch",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"autoAttachChildProcesses": true,
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
"stopOnEntry": false,
"sourceMaps": true,
"outFiles": [
"${workspaceFolder}/out/**/*.js"
Expand All @@ -36,10 +36,10 @@
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"autoAttachChildProcesses": true,
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
"stopOnEntry": false,
"sourceMaps": true,
"outFiles": [
"${workspaceFolder}/out/**/*.js"
Expand Down
32 changes: 30 additions & 2 deletions src/devtoolsPanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -406,12 +406,40 @@ export class DevToolsPanel {
private onSocketDevToolsConnection(success: string) {
if (success === 'true') {
void this.context.globalState.update('fallbackRevision', this.currentRevision);
this.context.globalState.update('retryAttemptToLoadCDN', '1');
} else {
// Retry connection with fallback.
const fallbackRevision = this.context.globalState.get<string>('fallbackRevision') ?? '';
let retryNumber: number;
try {
retryNumber = parseInt(this.context.globalState.get<string>('retryAttemptToLoadCDN') || '1', 10);
} catch {
retryNumber = 1;
}

let fallbackRevision;
switch (retryNumber) {
case 1: {
// Always try the latest specified revision first, this will keep it updated.
fallbackRevision = CDN_FALLBACK_REVISION;
this.context.globalState.update('retryAttemptToLoadCDN', ++retryNumber);
break;
}
case 2: {
// Retry connection with latest well known fallback that this environment knows.
fallbackRevision = this.context.globalState.get<string>('fallbackRevision') ?? '';
this.context.globalState.update('retryAttemptToLoadCDN', ++retryNumber);
break;
}
default: {
// Could not find suitable version.
this.context.globalState.update('retryAttemptToLoadCDN', '1');
return;
}
}

if (this.currentRevision) {
this.telemetryReporter.sendTelemetryEvent('websocket/failedConnection', {revision: this.currentRevision});
}

this.setCdnParameters({revision: fallbackRevision, isHeadless: this.isHeadless});
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ export const SETTINGS_DEFAULT_ENTRY_POINT = 'index.html';
const WIN_APP_DATA = process.env.LOCALAPPDATA || '/';
const msEdgeBrowserMapping: Map<BrowserFlavor, IBrowserPath> = new Map<BrowserFlavor, IBrowserPath>();

// Current Revision: 120.0.2210.181
export const CDN_FALLBACK_REVISION = '@6e7adbe405f69993cc1eb8c5dc9ea51868c4fb36';
// Current Revision: 127.0.2594.0
export const CDN_FALLBACK_REVISION = '@xxf163ae219c3b08cda5aafa6b262442715a8a9893';

/** Build-specified flags. */
declare const DEBUG: boolean;
Expand Down
6 changes: 0 additions & 6 deletions src/versionSocketConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,6 @@ export class BrowserVersionDetectionSocket extends EventEmitter {
const minSupportedVersion = MIN_SUPPORTED_VERSION.split('.').map(part => Number(part));
const currentRevision = data.result.revision || '';

// TODO: Workaround https://github.com/microsoft/vscode-edge-devtools/issues/1992
// remove when it has been fixed
if (parseFloat(versionNum) > 121) {
return {revision: '@d550f77b048ac142a3292397c64cdb693e4aca08', isHeadless};
}

for (let i = 0; i < currentVersion.length; i++) {
// Loop through from Major to minor numbers
if (currentVersion[i] > minSupportedVersion[i]) {
Expand Down

0 comments on commit 81b5615

Please sign in to comment.