Invoke session change emitter when session is created in getSession (#192828)

fixes https://github.com/microsoft/vscode/issues/192806
This commit is contained in:
Tyler James Leonhardt 2023-09-12 09:13:33 -07:00 committed by GitHub
parent 01f471f25c
commit 379d31d162
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -260,6 +260,7 @@ export class AzureActiveDirectoryService {
this._logger.trace(`[${scopeData.scopeStr}] '${token.sessionId}' Found a matching token with a different scopes '${token.scope}'. Attempting to get a new session using the existing session.`); this._logger.trace(`[${scopeData.scopeStr}] '${token.sessionId}' Found a matching token with a different scopes '${token.scope}'. Attempting to get a new session using the existing session.`);
try { try {
const itoken = await this.doRefreshToken(token.refreshToken, scopeData); const itoken = await this.doRefreshToken(token.refreshToken, scopeData);
this._sessionChangeEmitter.fire({ added: [this.convertToSessionSync(itoken)], removed: [], changed: [] });
matchingTokens.push(itoken); matchingTokens.push(itoken);
} catch (err) { } catch (err) {
this._logger.error(`[${scopeData.scopeStr}] Attempted to get a new session using the existing session with scopes '${token.scope}' but it failed due to: ${err.message ?? err}`); this._logger.error(`[${scopeData.scopeStr}] Attempted to get a new session using the existing session with scopes '${token.scope}' but it failed due to: ${err.message ?? err}`);