Skip to content

Commit 76e7800

Browse files
jeanp413mustard-mh
andauthored
Add retry dialog in onGitpodRemoteConnection (#42)
* Add retry dialog in onGitpodRemoteConnection * Show restart dialog when it's not running * Remove trigger event for heartbeat telemetry --------- Co-authored-by: hwen <[email protected]>
1 parent b0449b8 commit 76e7800

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/heartbeat.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ export class HeartbeatManager extends Disposable {
146146
const suffix = wasClosed ? 'closed heartbeat' : 'heartbeat';
147147
e.message = `Failed to send ${suffix}, triggered by event: ${this.lastActivityEvent}: ${e.message}`;
148148
this.logger.error(e);
149+
e.message = `Failed to send ${suffix}: ${e.message}`;
149150
this.telemetry.sendTelemetryException(e, { workspaceId: this.workspaceId, instanceId: this.instanceId, userId: this.session.account.id });
150151
}
151152
}

src/remoteConnector.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,13 +1070,25 @@ export default class RemoteConnector extends Disposable {
10701070

10711071
vscode.commands.executeCommand('setContext', 'gitpod.inWorkspace', true);
10721072
} catch (e) {
1073+
const remoteFlow = { ...connectionInfo, userId: session?.account.id, flow: 'remote_window' };
10731074
if (e instanceof NoRunningInstanceError) {
10741075
this.logger.error('No Running instance:', e);
1076+
const workspaceUrl = new URL(connectionInfo.gitpodHost);
1077+
workspaceUrl.pathname = '/start';
1078+
workspaceUrl.hash = connectionInfo.workspaceId;
1079+
this.showWsNotRunningDialog(connectionInfo.workspaceId, workspaceUrl.toString(), remoteFlow)
10751080
return;
10761081
}
10771082
e.message = `Failed to resolve whole gitpod remote connection process: ${e.message}`;
10781083
this.logger.error(e);
10791084
this.telemetry.sendTelemetryException(e, { workspaceId: connectionInfo.workspaceId, instanceId: connectionInfo.instanceId, userId: session?.account.id || '' });
1085+
1086+
this.logger.show();
1087+
const retry = 'Retry';
1088+
const action = await this.notifications.showErrorMessage(`Failed to resolve connection to Gitpod workspace: workspace could stop unexpectedly`, { flow: remoteFlow, id: uuid() }, retry);
1089+
if (action === retry) {
1090+
this.onGitpodRemoteConnection({ remoteAuthority, connectionInfo });
1091+
}
10801092
}
10811093
}
10821094

0 commit comments

Comments
 (0)