Fix: Updating fallback version to 127

Updates fallback version to use Edge 127 also fixes an issue where if the user had a well known version set in the cache it always use that one, even if a new one is present.
Close
This commit is contained in:
Vidal Ortega 2024-09-16 14:15:34 -07:00 коммит произвёл GitHub
Родитель fd9e35164f
Коммит 2002d856f2
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
4 изменённых файлов: 36 добавлений и 14 удалений

8
.vscode/launch.json поставляемый
Просмотреть файл

@ -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"
@ -36,10 +36,10 @@
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"autoAttachChildProcesses": true,
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
"stopOnEntry": false,
"sourceMaps": true,
"outFiles": [
"${workspaceFolder}/out/**/*.js"

Просмотреть файл

@ -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});
}
}

Просмотреть файл

@ -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;

Просмотреть файл

@ -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]) {