Skip to content

Commit ac7b11e

Browse files
committed
turn off visibleProgress on ConnectionLost
1 parent 695f462 commit ac7b11e

File tree

1 file changed

+23
-42
lines changed

1 file changed

+23
-42
lines changed

ci/dev/vscode.patch

+23-42
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,7 @@ index 3715cbb8e6ee41c3d9b5090918d243b723ae2d00..c65de8ad37e727d66da97a8f8b170cbc
689689
-
690690
-
691691
diff --git a/src/vs/platform/remote/common/remoteAgentConnection.ts b/src/vs/platform/remote/common/remoteAgentConnection.ts
692-
index 18d3d04fd20335975293e37b3b641120dd92da20..e072fc38ccd950462f42fdf112c8e7e673f351f5 100644
692+
index 18d3d04fd20335975293e37b3b641120dd92da20..48ba6434bd5fbd96919b1e109f350016b97aadc0 100644
693693
--- a/src/vs/platform/remote/common/remoteAgentConnection.ts
694694
+++ b/src/vs/platform/remote/common/remoteAgentConnection.ts
695695
@@ -92,7 +92,7 @@ async function connectToRemoteExtensionHostAgent(options: ISimpleConnectionOptio
@@ -701,53 +701,15 @@ index 18d3d04fd20335975293e37b3b641120dd92da20..e072fc38ccd950462f42fdf112c8e7e6
701701
(err: any, socket: ISocket | undefined) => {
702702
if (err || !socket) {
703703
options.logService.error(`${logPrefix} socketFactory.connect() failed. Error:`);
704-
@@ -411,16 +411,23 @@ abstract class PersistentConnection extends Disposable {
705-
}
706-
const logPrefix = commonLogPrefix(this._connectionType, this.reconnectionToken, true);
704+
@@ -413,6 +413,8 @@ abstract class PersistentConnection extends Disposable {
707705
this._options.logService.info(`${logPrefix} starting reconnecting loop. You can get more information with the trace log level.`);
708-
- this._onDidStateChange.fire(new ConnectionLostEvent());
706+
this._onDidStateChange.fire(new ConnectionLostEvent());
709707
const TIMES = [5, 5, 10, 10, 10, 10, 10, 30];
710-
+ const SHOW_POPUP_ON_ATTEMPT = 2 // aka third attempt
708+
+ // const SHOW_POPUP_ON_ATTEMPT = 2 // aka third attempt
711709
+
712710
const disconnectStartTime = Date.now();
713711
let attempt = -1;
714712
do {
715-
attempt++;
716-
+ if (attempt == SHOW_POPUP_ON_ATTEMPT){
717-
+ this._onDidStateChange.fire(new ConnectionLostEvent());
718-
+ }
719-
+
720-
const waitTime = (attempt < TIMES.length ? TIMES[attempt] : TIMES[TIMES.length - 1]);
721-
try {
722-
const sleepPromise = sleep(waitTime);
723-
- this._onDidStateChange.fire(new ReconnectionWaitEvent(waitTime, sleepPromise));
724-
+ if (attempt >= SHOW_POPUP_ON_ATTEMPT) {
725-
+ this._onDidStateChange.fire(new ReconnectionWaitEvent(waitTime, sleepPromise));
726-
+ }
727-
728-
this._options.logService.info(`${logPrefix} waiting for ${waitTime} seconds before reconnecting...`);
729-
try {
730-
@@ -433,14 +440,17 @@ abstract class PersistentConnection extends Disposable {
731-
}
732-
733-
// connection was lost, let's try to re-establish it
734-
- this._onDidStateChange.fire(new ReconnectionRunningEvent());
735-
+ if (attempt >= SHOW_POPUP_ON_ATTEMPT){
736-
+ this._onDidStateChange.fire(new ReconnectionRunningEvent());
737-
+ }
738-
this._options.logService.info(`${logPrefix} resolving connection...`);
739-
const simpleOptions = await resolveConnectionOptions(this._options, this.reconnectionToken, this.protocol);
740-
this._options.logService.info(`${logPrefix} connecting to ${simpleOptions.host}:${simpleOptions.port}...`);
741-
await connectWithTimeLimit(simpleOptions.logService, this._reconnect(simpleOptions), RECONNECT_TIMEOUT);
742-
this._options.logService.info(`${logPrefix} reconnected!`);
743-
- this._onDidStateChange.fire(new ConnectionGainEvent());
744-
-
745-
+ if (attempt >= SHOW_POPUP_ON_ATTEMPT) {
746-
+ this._onDidStateChange.fire(new ConnectionGainEvent());
747-
+ }
748-
break;
749-
} catch (err) {
750-
if (err.code === 'VSCODE_CONNECTION_ERROR') {
751713
diff --git a/src/vs/platform/storage/browser/storageService.ts b/src/vs/platform/storage/browser/storageService.ts
752714
index ab3fd347b69f8a3d9b96e706cd87c911b8ffed6b..9d351037b577f9f1edfd18ae9b3c48a211f4467f 100644
753715
--- a/src/vs/platform/storage/browser/storageService.ts
@@ -3246,6 +3208,25 @@ index 94e7e7a4bac154c45078a1b5034e50634a7a43af..8164200dcef1efbc65b50eef9c270af3
32463208
this._filenameKey.set(value ? basename(value) : null);
32473209
this._dirnameKey.set(value ? dirname(value).fsPath : null);
32483210
this._pathKey.set(value ? value.fsPath : null);
3211+
diff --git a/src/vs/workbench/contrib/remote/browser/remote.ts b/src/vs/workbench/contrib/remote/browser/remote.ts
3212+
index 98573a206f14928fc3fdf18fe927cb75034e4ad1..2f6a2fd6733e286024d20530773e3fbc26ffe16c 100644
3213+
--- a/src/vs/workbench/contrib/remote/browser/remote.ts
3214+
+++ b/src/vs/workbench/contrib/remote/browser/remote.ts
3215+
@@ -795,10 +795,10 @@ class RemoteAgentConnectionStatusListener implements IWorkbenchContribution {
3216+
}
3217+
switch (e.type) {
3218+
case PersistentConnectionEventType.ConnectionLost:
3219+
- if (!visibleProgress) {
3220+
- visibleProgress = showProgress(ProgressLocation.Dialog, [reconnectButton, reloadButton]);
3221+
- }
3222+
- visibleProgress.report(nls.localize('connectionLost', "Connection Lost"));
3223+
+ // if (!visibleProgress) {
3224+
+ // visibleProgress = showProgress(ProgressLocation.Dialog, [reconnectButton, reloadButton]);
3225+
+ // }
3226+
+ // visibleProgress.report(nls.localize('connectionLost', "Connection Lost"));
3227+
break;
3228+
case PersistentConnectionEventType.ReconnectionWait:
3229+
reconnectWaitEvent = e;
32493230
diff --git a/src/vs/workbench/contrib/scm/browser/media/scm.css b/src/vs/workbench/contrib/scm/browser/media/scm.css
32503231
index ac44ad3bae428def66e22fe9cc1c54648d429f6b..faa63023c4c586b51fa3c2a48ff3641b9cb0e145 100644
32513232
--- a/src/vs/workbench/contrib/scm/browser/media/scm.css

0 commit comments

Comments
 (0)