From 424d7a0e7797157a270d6b61e0fa04cb76c985c6 Mon Sep 17 00:00:00 2001 From: hkobew Date: Mon, 10 Feb 2025 10:59:15 -0500 Subject: [PATCH 1/7] feat: implement throttle --- .../src/shared/utilities/functionUtils.ts | 26 ++++++++++ .../shared/utilities/functionUtils.test.ts | 52 ++++++++++++++++++- 2 files changed, 77 insertions(+), 1 deletion(-) diff --git a/packages/core/src/shared/utilities/functionUtils.ts b/packages/core/src/shared/utilities/functionUtils.ts index 3bcb87730fa..107b8c79262 100644 --- a/packages/core/src/shared/utilities/functionUtils.ts +++ b/packages/core/src/shared/utilities/functionUtils.ts @@ -156,3 +156,29 @@ export function keyedDebounce( return promise } } + +/** + * Wraps the target function such that it will only execute after {@link delay} milliseconds have passed + * since the last invocation. Omitting {@link delay} will not execute the function for + * a single event loop. + * + * Multiple calls made during the throttle window will return the last returned result. + */ +export function throttle( + fn: (...args: Input) => Output | Promise, + delay: number = 0 +): (...args: Input) => Promise { + let lastResult: Output + let timeout: Timeout | undefined + + return async (...args: Input) => { + if (timeout) { + return lastResult + } + + timeout = new Timeout(delay) + timeout.onCompletion(() => (timeout = undefined)) + + return (lastResult = (await fn(...args)) as Output) + } +} diff --git a/packages/core/src/test/shared/utilities/functionUtils.test.ts b/packages/core/src/test/shared/utilities/functionUtils.test.ts index 43da4ebb619..ae73edfa73a 100644 --- a/packages/core/src/test/shared/utilities/functionUtils.test.ts +++ b/packages/core/src/test/shared/utilities/functionUtils.test.ts @@ -4,7 +4,7 @@ */ import assert from 'assert' -import { once, onceChanged, debounce } from '../../../shared/utilities/functionUtils' +import { once, onceChanged, debounce, throttle } from '../../../shared/utilities/functionUtils' import { installFakeClock } from '../../testUtil' describe('functionUtils', function () { @@ -107,3 +107,53 @@ describe('debounce', function () { }) }) }) + +describe('throttle', function () { + let counter: number + let fn: () => Promise + let clock: ReturnType + + const callAndSleep = async (delayInMs: number) => { + const r = await fn() + await clock.tickAsync(delayInMs) + return r + } + + const callAndSleepN = async (delayInMs: number, n: number) => { + const results = [] + for (const _ of Array.from({ length: n })) { + results.push(await callAndSleep(delayInMs)) + } + return results + } + + beforeEach(function () { + clock = installFakeClock() + counter = 0 + fn = throttle(() => ++counter, 10) + }) + + afterEach(function () { + clock.uninstall() + }) + + it('prevents a function from executing more than once in the `delay` window', async function () { + await callAndSleepN(3, 3) + assert.strictEqual(counter, 1, 'total calls should be 1') + }) + + it('returns cached value on subsequent calls within window', async function () { + const result = await callAndSleepN(3, 3) + assert.deepStrictEqual(result, [1, 1, 1], 'all calls in window should return cached value') + }) + + it('updates cache for next window', async function () { + const result = await callAndSleepN(10, 3) + assert.deepStrictEqual(result, [1, 2, 3], 'each call should return a new value') + }) + + it('properly manages rolling cache window', async function () { + const result = await callAndSleepN(5, 10) + assert.deepStrictEqual(result, [1, 1, 2, 2, 3, 3, 4, 4, 5, 5]) + }) +}) From 829166b709be25a1a6f8cea1ea148e77223cd6dc Mon Sep 17 00:00:00 2001 From: hkobew Date: Mon, 10 Feb 2025 11:07:12 -0500 Subject: [PATCH 2/7] refactor: move throttle up --- packages/core/src/auth/auth.ts | 8 +++++--- .../src/auth/providers/credentialsProviderManager.ts | 12 ++++-------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/packages/core/src/auth/auth.ts b/packages/core/src/auth/auth.ts index fba0c80e261..a8285162eca 100644 --- a/packages/core/src/auth/auth.ts +++ b/packages/core/src/auth/auth.ts @@ -21,7 +21,7 @@ import { SsoClient } from './sso/clients' import { getLogger } from '../shared/logger' import { CredentialsProviderManager } from './providers/credentialsProviderManager' import { asString, CredentialsId, CredentialsProvider, fromString } from './providers/credentials' -import { keyedDebounce, once } from '../shared/utilities/functionUtils' +import { keyedDebounce, once, throttle } from '../shared/utilities/functionUtils' import { CredentialsSettings } from './credentials/utils' import { extractDataFromSection, @@ -248,8 +248,8 @@ export class Auth implements AuthService, ConnectionManager { this.#onDidChangeActiveConnection.fire(undefined) } - @withTelemetryContext({ name: 'listConnections', class: authClassName }) - public async listConnections(): Promise { + @withTelemetryContext({ name: 'listConnections', class: authClassName, emit: true }) + private async listConnectionsDefault(): Promise { await loadIamProfilesIntoStore(this.store, this.iamProfileProvider) const connections = await Promise.all( @@ -259,6 +259,8 @@ export class Auth implements AuthService, ConnectionManager { return connections } + public listConnections = throttle(() => this.listConnectionsDefault(), 500) + /** * Gathers all local profiles plus any AWS accounts/roles associated with SSO ("IAM Identity * Center", "IdC") connections. diff --git a/packages/core/src/auth/providers/credentialsProviderManager.ts b/packages/core/src/auth/providers/credentialsProviderManager.ts index a2736cabc18..00d874f3e02 100644 --- a/packages/core/src/auth/providers/credentialsProviderManager.ts +++ b/packages/core/src/auth/providers/credentialsProviderManager.ts @@ -4,9 +4,8 @@ */ import { getLogger } from '../../shared/logger' -import { AwsLoadCredentials, telemetry } from '../../shared/telemetry/telemetry' +import { telemetry } from '../../shared/telemetry/telemetry' import { withTelemetryContext } from '../../shared/telemetry/util' -import { cancellableDebounce } from '../../shared/utilities/functionUtils' import { asString, CredentialsProvider, @@ -26,7 +25,7 @@ export class CredentialsProviderManager { private readonly providerFactories: CredentialsProviderFactory[] = [] private readonly providers: CredentialsProvider[] = [] - @withTelemetryContext({ name: 'getAllCredentialsProvider', class: credentialsProviderManagerClassName, emit: true }) + @withTelemetryContext({ name: 'getAllCredentialsProvider', class: credentialsProviderManagerClassName }) public async getAllCredentialsProviders(): Promise { let providers: CredentialsProvider[] = [] @@ -52,7 +51,7 @@ export class CredentialsProviderManager { continue } - void this.emitWithDebounce({ + telemetry.aws_loadCredentials.emit({ credentialSourceId: credentialsProviderToTelemetryType(providerType), value: refreshed.length, }) @@ -61,10 +60,7 @@ export class CredentialsProviderManager { return providers } - private emitWithDebounce = cancellableDebounce( - (m: AwsLoadCredentials) => telemetry.aws_loadCredentials.emit(m), - 100 - ).promise + /** * Returns a map of `CredentialsProviderId` string-forms to object-forms, * from all credential sources. Only available providers are returned. From 595b6d55ff63bbc68d02b5ffcf47b75fb4c98b5f Mon Sep 17 00:00:00 2001 From: hkobew Date: Mon, 10 Feb 2025 11:15:18 -0500 Subject: [PATCH 3/7] feat: add more decorators to track --- packages/core/src/auth/auth.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/core/src/auth/auth.ts b/packages/core/src/auth/auth.ts index a8285162eca..104be230218 100644 --- a/packages/core/src/auth/auth.ts +++ b/packages/core/src/auth/auth.ts @@ -417,6 +417,7 @@ export class Auth implements AuthService, ConnectionManager { await setContext('aws.isInternalUser', false) } + @withTelemetryContext({ name: 'getConnection', class: authClassName }) public async getConnection(connection: Pick): Promise { const connections = await this.listConnections() @@ -524,6 +525,7 @@ export class Auth implements AuthService, ConnectionManager { await this.thrownOnConn(id, 'exists') } + @withTelemetryContext({ name: 'thrownOnConn', class: authClassName }) private async thrownOnConn(id: CredentialsId, throwOn: 'exists' | 'not-exists') { const idAsString = asString(id) const conns = await this.listConnections() // triggers loading of profile in to store From 2a2f013f50864d1e9fd95e9e303954599c2935ad Mon Sep 17 00:00:00 2001 From: hkobew Date: Mon, 10 Feb 2025 11:15:32 -0500 Subject: [PATCH 4/7] test: update techdebt test --- packages/core/src/test/techdebt.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/core/src/test/techdebt.test.ts b/packages/core/src/test/techdebt.test.ts index 25a1d83d4f6..6dd76bd03d0 100644 --- a/packages/core/src/test/techdebt.test.ts +++ b/packages/core/src/test/techdebt.test.ts @@ -42,8 +42,8 @@ describe('tech debt', function () { it('remove debugging telemetry', async function () { fixByDate( - '2025-02-11', - 'Remove debugging telemetry in `packages/core/src/auth/providers/credentialsProviderManager.ts`. Should only need to remove the `emit: true` in the decorator.' + '2025-02-18', + 'Remove debugging telemetry in `packages/core/src/auth/auth.ts`. Should only need to remove the `emit: true` in the decorator.' ) }) }) From b71d84a675a65d9139ac81771910c67161e6174f Mon Sep 17 00:00:00 2001 From: hkobew Date: Mon, 10 Feb 2025 12:00:22 -0500 Subject: [PATCH 5/7] refactor: move throttle down to avoid side effects --- packages/core/src/auth/auth.ts | 8 +++----- .../src/auth/providers/credentialsProviderManager.ts | 11 +++++++++-- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/packages/core/src/auth/auth.ts b/packages/core/src/auth/auth.ts index 104be230218..e3a71882196 100644 --- a/packages/core/src/auth/auth.ts +++ b/packages/core/src/auth/auth.ts @@ -21,7 +21,7 @@ import { SsoClient } from './sso/clients' import { getLogger } from '../shared/logger' import { CredentialsProviderManager } from './providers/credentialsProviderManager' import { asString, CredentialsId, CredentialsProvider, fromString } from './providers/credentials' -import { keyedDebounce, once, throttle } from '../shared/utilities/functionUtils' +import { keyedDebounce, once } from '../shared/utilities/functionUtils' import { CredentialsSettings } from './credentials/utils' import { extractDataFromSection, @@ -248,8 +248,8 @@ export class Auth implements AuthService, ConnectionManager { this.#onDidChangeActiveConnection.fire(undefined) } - @withTelemetryContext({ name: 'listConnections', class: authClassName, emit: true }) - private async listConnectionsDefault(): Promise { + @withTelemetryContext({ name: 'listConnections', class: authClassName }) + public async listConnections(): Promise { await loadIamProfilesIntoStore(this.store, this.iamProfileProvider) const connections = await Promise.all( @@ -259,8 +259,6 @@ export class Auth implements AuthService, ConnectionManager { return connections } - public listConnections = throttle(() => this.listConnectionsDefault(), 500) - /** * Gathers all local profiles plus any AWS accounts/roles associated with SSO ("IAM Identity * Center", "IdC") connections. diff --git a/packages/core/src/auth/providers/credentialsProviderManager.ts b/packages/core/src/auth/providers/credentialsProviderManager.ts index 00d874f3e02..d172ad7014d 100644 --- a/packages/core/src/auth/providers/credentialsProviderManager.ts +++ b/packages/core/src/auth/providers/credentialsProviderManager.ts @@ -6,6 +6,7 @@ import { getLogger } from '../../shared/logger' import { telemetry } from '../../shared/telemetry/telemetry' import { withTelemetryContext } from '../../shared/telemetry/util' +import { throttle } from '../../shared/utilities/functionUtils' import { asString, CredentialsProvider, @@ -65,8 +66,12 @@ export class CredentialsProviderManager { * Returns a map of `CredentialsProviderId` string-forms to object-forms, * from all credential sources. Only available providers are returned. */ - @withTelemetryContext({ name: 'getCredentialProviderNames', class: credentialsProviderManagerClassName }) - public async getCredentialProviderNames(): Promise<{ [key: string]: CredentialsId }> { + @withTelemetryContext({ + name: 'getCredentialProviderNames', + class: credentialsProviderManagerClassName, + emit: true, + }) + private async getCredentialProviderNamesDefault(): Promise<{ [key: string]: CredentialsId }> { const m: { [key: string]: CredentialsId } = {} for (const o of await this.getAllCredentialsProviders()) { m[asString(o.getCredentialsId())] = o.getCredentialsId() @@ -75,6 +80,8 @@ export class CredentialsProviderManager { return m } + public getCredentialProviderNames = throttle(() => this.getCredentialProviderNamesDefault(), 500) + public async getCredentialsProvider(credentials: CredentialsId): Promise { for (const provider of this.providers) { if (isEqual(provider.getCredentialsId(), credentials) && (await provider.isAvailable())) { From f3bf5463c9c38a26d54351b171bc5b64db45bd84 Mon Sep 17 00:00:00 2001 From: hkobew Date: Mon, 10 Feb 2025 13:22:27 -0500 Subject: [PATCH 6/7] refactor: increase debugging trail of function_call --- packages/core/src/auth/sso/validation.ts | 1 + packages/core/src/auth/utils.ts | 87 ++++++++++++------- packages/core/src/codecatalyst/auth.ts | 1 + .../core/src/codewhisperer/util/authUtil.ts | 1 + packages/core/src/dev/activation.ts | 15 ++-- packages/core/src/extensionNode.ts | 65 +++++++------- .../webview/vue/toolkit/backend_toolkit.ts | 3 + 7 files changed, 106 insertions(+), 67 deletions(-) diff --git a/packages/core/src/auth/sso/validation.ts b/packages/core/src/auth/sso/validation.ts index cad6aa7f4c3..d09d6a50e19 100644 --- a/packages/core/src/auth/sso/validation.ts +++ b/packages/core/src/auth/sso/validation.ts @@ -18,6 +18,7 @@ export function validateSsoUrlFormat(url: string) { } } +// TODO: Remove this if unused? export async function validateIsNewSsoUrlAsync( auth: Auth, url: string, diff --git a/packages/core/src/auth/utils.ts b/packages/core/src/auth/utils.ts index dd008a55fb4..3f4acf66ced 100644 --- a/packages/core/src/auth/utils.ts +++ b/packages/core/src/auth/utils.ts @@ -598,29 +598,39 @@ export async function hasSso( kind: SsoKind = 'any', allConnections = () => Auth.instance.listConnections() ): Promise { - return (await findSsoConnections(kind, allConnections)).length > 0 + return telemetry.function_call.run( + async () => { + return (await findSsoConnections(kind, allConnections)).length > 0 + }, + { emit: false, functionId: { name: 'hasSso', class: 'utils' } } + ) } export async function findSsoConnections( kind: SsoKind = 'any', allConnections = () => Auth.instance.listConnections() ): Promise { - let predicate: (c?: Connection) => boolean - switch (kind) { - case 'codewhisperer': - predicate = (conn?: Connection) => { - return isIdcSsoConnection(conn) && isValidCodeWhispererCoreConnection(conn) - } - break - case 'codecatalyst': - predicate = (conn?: Connection) => { - return isIdcSsoConnection(conn) && isValidCodeCatalystConnection(conn) + return telemetry.function_call.run( + async () => { + let predicate: (c?: Connection) => boolean + switch (kind) { + case 'codewhisperer': + predicate = (conn?: Connection) => { + return isIdcSsoConnection(conn) && isValidCodeWhispererCoreConnection(conn) + } + break + case 'codecatalyst': + predicate = (conn?: Connection) => { + return isIdcSsoConnection(conn) && isValidCodeCatalystConnection(conn) + } + break + case 'any': + predicate = isIdcSsoConnection } - break - case 'any': - predicate = isIdcSsoConnection - } - return (await allConnections()).filter(predicate).filter(isIdcSsoConnection) + return (await allConnections()).filter(predicate).filter(isIdcSsoConnection) + }, + { emit: false, functionId: { name: 'findSsoConnections', class: 'utils' } } + ) } export type BuilderIdKind = 'any' | 'codewhisperer' | 'codecatalyst' @@ -635,29 +645,42 @@ export async function hasBuilderId( kind: BuilderIdKind = 'any', allConnections = () => Auth.instance.listConnections() ): Promise { - return (await findBuilderIdConnections(kind, allConnections)).length > 0 + return telemetry.function_call.run( + async () => { + return (await findBuilderIdConnections(kind, allConnections)).length > 0 + }, + { emit: false, functionId: { name: 'hasBuilderId', class: 'utils' } } + ) } async function findBuilderIdConnections( kind: BuilderIdKind = 'any', allConnections = () => Auth.instance.listConnections() ): Promise { - let predicate: (c?: Connection) => boolean - switch (kind) { - case 'codewhisperer': - predicate = (conn?: Connection) => { - return isBuilderIdConnection(conn) && isValidCodeWhispererCoreConnection(conn) - } - break - case 'codecatalyst': - predicate = (conn?: Connection) => { - return isBuilderIdConnection(conn) && isValidCodeCatalystConnection(conn) + return telemetry.function_call.run( + async () => { + let predicate: (c?: Connection) => boolean + switch (kind) { + case 'codewhisperer': + predicate = (conn?: Connection) => { + return isBuilderIdConnection(conn) && isValidCodeWhispererCoreConnection(conn) + } + break + case 'codecatalyst': + predicate = (conn?: Connection) => { + return isBuilderIdConnection(conn) && isValidCodeCatalystConnection(conn) + } + break + case 'any': + predicate = isBuilderIdConnection } - break - case 'any': - predicate = isBuilderIdConnection - } - return (await allConnections()).filter(predicate).filter(isAnySsoConnection) + return (await allConnections()).filter(predicate).filter(isAnySsoConnection) + }, + { + emit: false, + functionId: { name: 'findBuilderIdConnections', class: 'utils' }, + } + ) } /** diff --git a/packages/core/src/codecatalyst/auth.ts b/packages/core/src/codecatalyst/auth.ts index 11e31a37c4f..be8d370bec0 100644 --- a/packages/core/src/codecatalyst/auth.ts +++ b/packages/core/src/codecatalyst/auth.ts @@ -203,6 +203,7 @@ export class CodeCatalystAuthenticationProvider { * This cannot create a Builder ID, but will return an existing Builder ID, * upgrading the scopes if necessary. */ + @withTelemetryContext({ name: 'tryGetBuilderIdConnection', class: authClassName }) public async tryGetBuilderIdConnection(): Promise { if (this.activeConnection && isBuilderIdConnection(this.activeConnection)) { return this.activeConnection diff --git a/packages/core/src/codewhisperer/util/authUtil.ts b/packages/core/src/codewhisperer/util/authUtil.ts index 1a94ad5ffcc..1d8484b2d45 100644 --- a/packages/core/src/codewhisperer/util/authUtil.ts +++ b/packages/core/src/codewhisperer/util/authUtil.ts @@ -476,6 +476,7 @@ export class AuthUtil { * auth connections that the Amazon Q extension has cached. We need to remove these * as they are irrelevant to the Q extension and can cause issues. */ + @withTelemetryContext({ name: 'clearExtraConnections', class: authClassName }) public async clearExtraConnections(): Promise { const currentQConn = this.conn // Q currently only maintains 1 connection at a time, so we assume everything else is extra. diff --git a/packages/core/src/dev/activation.ts b/packages/core/src/dev/activation.ts index 15baf1bc294..702678775d1 100644 --- a/packages/core/src/dev/activation.ts +++ b/packages/core/src/dev/activation.ts @@ -495,10 +495,15 @@ async function editSsoConnections() { } async function deleteSsoConnections() { - const conns = targetAuth.listConnections() - const ssoConns = (await conns).filter(isAnySsoConnection) - await Promise.all(ssoConns.map((conn) => targetAuth.deleteConnection(conn))) - void vscode.window.showInformationMessage(`Deleted: ${ssoConns.map((c) => c.startUrl).join(', ')}`) + return telemetry.function_call.run( + async () => { + const conns = targetAuth.listConnections() + const ssoConns = (await conns).filter(isAnySsoConnection) + await Promise.all(ssoConns.map((conn) => targetAuth.deleteConnection(conn))) + void vscode.window.showInformationMessage(`Deleted: ${ssoConns.map((c) => c.startUrl).join(', ')}`) + }, + { emit: false, functionId: { name: 'deleteSsoConnectionsDev', class: 'activation' } } + ) } async function expireSsoConnections() { @@ -509,7 +514,7 @@ async function expireSsoConnections() { await Promise.all(ssoConns.map((conn) => targetAuth.expireConnection(conn))) void vscode.window.showInformationMessage(`Expired: ${ssoConns.map((c) => c.startUrl).join(', ')}`) }, - { emit: false, functionId: { name: 'expireSsoConnectionsDev' } } + { emit: false, functionId: { name: 'expireSsoConnectionsDev', class: 'activation' } } ) } diff --git a/packages/core/src/extensionNode.ts b/packages/core/src/extensionNode.ts index e2e63614381..086a5cdf5b7 100644 --- a/packages/core/src/extensionNode.ts +++ b/packages/core/src/extensionNode.ts @@ -324,40 +324,45 @@ function recordToolkitInitialization(activationStartedOn: number, settingsValid: } async function getAuthState(): Promise> { - let authStatus: AuthStatus = 'notConnected' - const enabledConnections: Set = new Set() - const enabledScopes: Set = new Set() - if (Auth.instance.hasConnections) { - authStatus = 'expired' - for (const conn of await Auth.instance.listConnections()) { - const state = Auth.instance.getConnectionState(conn) - if (state === 'valid') { - authStatus = 'connected' - } + return telemetry.function_call.run( + async () => { + let authStatus: AuthStatus = 'notConnected' + const enabledConnections: Set = new Set() + const enabledScopes: Set = new Set() + if (Auth.instance.hasConnections) { + authStatus = 'expired' + for (const conn of await Auth.instance.listConnections()) { + const state = Auth.instance.getConnectionState(conn) + if (state === 'valid') { + authStatus = 'connected' + } - for (const id of getAuthFormIdsFromConnection(conn)) { - enabledConnections.add(id) - } - if (isSsoConnection(conn)) { - if (conn.scopes) { - for (const s of conn.scopes) { - enabledScopes.add(s) + for (const id of getAuthFormIdsFromConnection(conn)) { + enabledConnections.add(id) + } + if (isSsoConnection(conn)) { + if (conn.scopes) { + for (const s of conn.scopes) { + enabledScopes.add(s) + } + } } } } - } - } - // There may be other SSO connections in toolkit, but there is no use case for - // displaying registration info for non-active connections at this time. - const activeConn = Auth.instance.activeConnection - if (activeConn?.type === 'sso') { - telemetry.record(await getTelemetryMetadataForConn(activeConn)) - } + // There may be other SSO connections in toolkit, but there is no use case for + // displaying registration info for non-active connections at this time. + const activeConn = Auth.instance.activeConnection + if (activeConn?.type === 'sso') { + telemetry.record(await getTelemetryMetadataForConn(activeConn)) + } - return { - authStatus, - authEnabledConnections: [...enabledConnections].sort().join(','), - authScopes: [...enabledScopes].sort().join(','), - } + return { + authStatus, + authEnabledConnections: [...enabledConnections].sort().join(','), + authScopes: [...enabledScopes].sort().join(','), + } + }, + { emit: false, functionId: { name: 'getAuthState', class: 'extensionNode' } } + ) } diff --git a/packages/core/src/login/webview/vue/toolkit/backend_toolkit.ts b/packages/core/src/login/webview/vue/toolkit/backend_toolkit.ts index b50fe563745..4f6332d908e 100644 --- a/packages/core/src/login/webview/vue/toolkit/backend_toolkit.ts +++ b/packages/core/src/login/webview/vue/toolkit/backend_toolkit.ts @@ -21,7 +21,9 @@ import { CodeCatalystAuthenticationProvider } from '../../../../codecatalyst/aut import { AuthError, AuthFlowState } from '../types' import { setContext } from '../../../../shared' import { builderIdStartUrl } from '../../../../auth/sso/constants' +import { withTelemetryContext } from '../../../../shared/telemetry/util' +const loginWebviewClass = 'ToolkitLoginWebview' export class ToolkitLoginWebview extends CommonAuthWebview { public override id: string = 'aws.toolkit.AmazonCommonAuth' public static sourcePath: string = 'vue/src/login/webview/vue/toolkit/index.js' @@ -147,6 +149,7 @@ export class ToolkitLoginWebview extends CommonAuthWebview { return connections } + @withTelemetryContext({ name: 'listSsoConnections', class: loginWebviewClass }) async listSsoConnections(): Promise { return (await Auth.instance.listConnections()).filter((conn) => isSsoConnection(conn)) as SsoConnection[] } From dc11836bbd695f86574f14a92e9414c729c682c9 Mon Sep 17 00:00:00 2001 From: hkobew Date: Mon, 10 Feb 2025 14:22:32 -0500 Subject: [PATCH 7/7] test: update techdebt test to reference correct file --- packages/core/src/test/techdebt.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/test/techdebt.test.ts b/packages/core/src/test/techdebt.test.ts index 6dd76bd03d0..d0106850e2d 100644 --- a/packages/core/src/test/techdebt.test.ts +++ b/packages/core/src/test/techdebt.test.ts @@ -43,7 +43,7 @@ describe('tech debt', function () { it('remove debugging telemetry', async function () { fixByDate( '2025-02-18', - 'Remove debugging telemetry in `packages/core/src/auth/auth.ts`. Should only need to remove the `emit: true` in the decorator.' + 'Remove debugging telemetry in `packages/core/src/auth/providers/credentialsProviderManager.ts`. Should only need to remove the `emit: true` in the decorator.' ) }) })