Fix MSAL Runtime telemetry not firing (#282595)

We were too strict. This should actually yield telemtry.

Fixes https://github.com/microsoft/vscode/issues/282593
This commit is contained in:
Tyler James Leonhardt
2025-12-10 15:48:55 -08:00
committed by GitHub
parent 71f35296d2
commit e3bbd5bb1d
2 changed files with 6 additions and 3 deletions

View File

@@ -2,7 +2,7 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { AccountInfo, AuthenticationResult, ClientAuthError, ClientAuthErrorCodes, ServerError, SilentFlowRequest } from '@azure/msal-node';
import { AccountInfo, AuthenticationResult, AuthError, ClientAuthError, ClientAuthErrorCodes, ServerError } from '@azure/msal-node';
import { AuthenticationChallenge, AuthenticationConstraint, AuthenticationGetSessionOptions, AuthenticationProvider, AuthenticationProviderAuthenticationSessionsChangeEvent, AuthenticationProviderSessionOptions, AuthenticationSession, AuthenticationSessionAccountInformation, CancellationError, env, EventEmitter, ExtensionContext, ExtensionKind, l10n, LogOutputChannel, Uri, window } from 'vscode';
import { Environment } from '@azure/ms-rest-azure-env';
import { CachedPublicClientApplicationManager } from './publicClientCache';
@@ -522,7 +522,7 @@ export class MsalAuthProvider implements AuthenticationProvider {
} catch (e) {
// If we can't get a token silently, the account is probably in a bad state so we should skip it
// MSAL will log this already, so we don't need to log it again
if (e instanceof ClientAuthError) {
if (e instanceof AuthError) {
this._telemetryReporter.sendTelemetryClientAuthErrorEvent(e);
} else {
this._telemetryReporter.sendTelemetryErrorEvent(e);