Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log a lot more of the Microsoft Auth extension #192629

Merged
merged 1 commit into from Sep 8, 2023

Conversation

TylerLeonhardt
Copy link
Member

@TylerLeonhardt TylerLeonhardt commented Sep 8, 2023

This PR adds a ton more logging, a consistant format, and fixes the log levels of some.

Additionally, there are two small fixes that I have included:

  • we were firing the _sessionChangeEmitter twice when a session was removed
  • when processing updates from other windows, we returned instead of continued... thus were only processing the first account that was added in another window

ref #186693

image

This PR adds a ton more logging, a consistant format, and fixes the log levels of some.

Additionally, there are two small fixes that I have included:
* we were firing the `_sessionChangeEmitter` twice when a session was removed
* when processing updates from other windows, we returned instead of continued... thus were only processing the first account that was added in another window
@TylerLeonhardt TylerLeonhardt self-assigned this Sep 8, 2023
@TylerLeonhardt TylerLeonhardt enabled auto-merge (squash) September 8, 2023 21:07
return Promise.resolve(undefined);
}

const token = this._tokens.splice(tokenIndex, 1)[0];
const session = await this.removeSessionByIToken(token, writeToDisk);

if (session) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bullet point 1

}

private async checkForUpdates(e: IDidChangeInOtherWindowEvent<IStoredSession>): Promise<void> {
for (const key of e.added) {
const session = await this._tokenStorage.get(key);
if (!session) {
this._logger.error('session not found that was apparently just added');
return;
continue;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bullet point 2

} catch (e) {
// Network failures will automatically retry on next poll.
if (e.message !== REFRESH_NETWORK_FAILURE) {
vscode.window.showErrorMessage(vscode.l10n.t('You have been signed out because reading stored authentication information failed.'));
await this.removeSessionById(session.id);
}
return;
continue;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bullet point 2

@VSCodeTriageBot VSCodeTriageBot added this to the September 2023 milestone Sep 8, 2023
@TylerLeonhardt TylerLeonhardt merged commit 52f27e2 into main Sep 8, 2023
7 checks passed
@TylerLeonhardt TylerLeonhardt deleted the tyler/elaborate-badger branch September 8, 2023 21:25
@github-actions github-actions bot locked and limited conversation to collaborators Oct 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants