Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move CDN fallback revision from settings to globalState #1024

Merged
Merged
Show file tree
Hide file tree
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
5 changes: 0 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -283,11 +283,6 @@
"type": "boolean",
"default": true,
"description": "Enable feedback from webhint on source files to improve accessibility, compatibility, security and more."
},
"vscode-edge-devtools.fallbackRevision": {
"type": "string",
"default": "@a41122be052fe9616f0def5fe6842fa942930d46",
"description": "Last known good revision used for when we fail to connect to the CDN with the current target revision."
}
}
},
Expand Down
5 changes: 2 additions & 3 deletions src/devtoolsPanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -389,11 +389,10 @@ export class DevToolsPanel {

private onSocketDevToolsConnection(success: string) {
if (success === 'true') {
void vscode.workspace.getConfiguration(SETTINGS_STORE_NAME).update('fallbackRevision', this.currentRevision, true);
void this.context.globalState.update('fallbackRevision', this.currentRevision);
} else {
// Retry connection with fallback.
const settingsConfig = vscode.workspace.getConfiguration(SETTINGS_STORE_NAME);
const fallbackRevision = settingsConfig.get('fallbackRevision') as string;
const fallbackRevision = this.context.globalState.get<string>('fallbackRevision') ?? '';
if (this.currentRevision) {
this.telemetryReporter.sendTelemetryEvent('websocket/failedConnection', {revision: this.currentRevision});
}
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: 94.0.992.31
export const CDN_FALLBACK_REVISION = '@fd65e6bbedc86a22f2393b7cd8d1585c54cada42';
// Current Revision: 102.0.1235.1
export const CDN_FALLBACK_REVISION = '@a41122be052fe9616f0def5fe6842fa942930d46';

/** Build-specified flags. */
declare const DEBUG: boolean;
Expand Down
3 changes: 2 additions & 1 deletion src/versionSocketConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import { EventEmitter } from 'events';
import WebSocket from 'ws';
import { WebSocketEvent } from './common/webviewEvents';
import { CDN_FALLBACK_REVISION } from './utils';

export type IDevToolsPostMessageCallback = (e: WebSocketEvent, message?: string) => void;

Expand All @@ -17,7 +18,7 @@ export interface BrowserVersionCdpResponse {

// Minimum supported version of Edge for source-mapped CSS mirroring
export const MIN_SUPPORTED_VERSION = '103.0.1252.0';
export const MIN_SUPPORTED_REVISION = '@a41122be052fe9616f0def5fe6842fa942930d46';
export const MIN_SUPPORTED_REVISION = CDN_FALLBACK_REVISION;

export class BrowserVersionDetectionSocket extends EventEmitter {
private readonly targetUrl: string;
Expand Down