Skip to content

Commit f1abeea

Browse files
authored
1 parent b50cc59 commit f1abeea

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/vs/workbench/contrib/sessionSync/browser/sessionSync.contribution.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,9 @@ export class SessionSyncContribution extends Disposable implements IWorkbenchCon
290290
}
291291
}
292292

293-
this.logService.info(`Edit Sessions: Deleting edit session with ref ${ref} after successfully applying it to current workspace.`);
293+
this.logService.info(`Edit Sessions: Deleting edit session with ref ${ref} after successfully applying it to current workspace...`);
294294
await this.sessionSyncWorkbenchService.delete(ref);
295+
this.logService.info(`Edit Sessions: Deleted edit session with ref ${ref}.`);
295296
} catch (ex) {
296297
this.logService.error('Edit Sessions: Failed to apply edit session, reason: ', (ex as Error).toString());
297298
this.notificationService.error(localize('apply failed', "Failed to apply your edit session."));

src/vs/workbench/services/sessionSync/browser/sessionSyncWorkbenchService.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@ export class SessionSyncWorkbenchService extends Disposable implements ISessionS
120120
}
121121

122122
private async initialize() {
123+
if (this.initialized) {
124+
return;
125+
}
123126
this.initialized = await this.doInitialize();
124127
this.signedInContext.set(this.initialized);
125128
}
@@ -152,9 +155,12 @@ export class SessionSyncWorkbenchService extends Disposable implements ISessionS
152155
}
153156

154157
// If the user signed in previously and the session is still available, reuse that without prompting the user again
155-
if (this.existingSessionId) {
158+
const existingSessionId = this.existingSessionId;
159+
if (existingSessionId) {
160+
this.logService.trace(`Edit Sessions: Searching for existing authentication session with ID ${existingSessionId}`);
156161
const existing = await this.getExistingSession();
157162
if (existing !== undefined) {
163+
this.logService.trace(`Edit Sessions: Found existing authentication session with ID ${existingSessionId}`);
158164
this.#authenticationInfo = { sessionId: existing.session.id, token: existing.session.accessToken, providerId: existing.session.providerId };
159165
this.storeClient.setAuthToken(this.#authenticationInfo.token, this.#authenticationInfo.providerId);
160166
return true;
@@ -167,6 +173,7 @@ export class SessionSyncWorkbenchService extends Disposable implements ISessionS
167173
this.#authenticationInfo = { sessionId: session.id, token: session.accessToken, providerId: session.providerId };
168174
this.storeClient.setAuthToken(this.#authenticationInfo.token, this.#authenticationInfo.providerId);
169175
this.existingSessionId = session.id;
176+
this.logService.trace(`Edit Sessions: Saving authentication session preference for ID ${session.id}.`);
170177
return true;
171178
}
172179

0 commit comments

Comments
 (0)