@@ -120,6 +120,9 @@ export class SessionSyncWorkbenchService extends Disposable implements ISessionS
120
120
}
121
121
122
122
private async initialize ( ) {
123
+ if ( this . initialized ) {
124
+ return ;
125
+ }
123
126
this . initialized = await this . doInitialize ( ) ;
124
127
this . signedInContext . set ( this . initialized ) ;
125
128
}
@@ -152,9 +155,12 @@ export class SessionSyncWorkbenchService extends Disposable implements ISessionS
152
155
}
153
156
154
157
// 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 } ` ) ;
156
161
const existing = await this . getExistingSession ( ) ;
157
162
if ( existing !== undefined ) {
163
+ this . logService . trace ( `Edit Sessions: Found existing authentication session with ID ${ existingSessionId } ` ) ;
158
164
this . #authenticationInfo = { sessionId : existing . session . id , token : existing . session . accessToken , providerId : existing . session . providerId } ;
159
165
this . storeClient . setAuthToken ( this . #authenticationInfo. token , this . #authenticationInfo. providerId ) ;
160
166
return true ;
@@ -167,6 +173,7 @@ export class SessionSyncWorkbenchService extends Disposable implements ISessionS
167
173
this . #authenticationInfo = { sessionId : session . id , token : session . accessToken , providerId : session . providerId } ;
168
174
this . storeClient . setAuthToken ( this . #authenticationInfo. token , this . #authenticationInfo. providerId ) ;
169
175
this . existingSessionId = session . id ;
176
+ this . logService . trace ( `Edit Sessions: Saving authentication session preference for ID ${ session . id } .` ) ;
170
177
return true ;
171
178
}
172
179
0 commit comments