Fixing review comments

This commit is contained in:
Srinath Padmanabhan
2026-03-05 16:06:08 -08:00
parent 0cbec42ed8
commit 81151d12b1
3 changed files with 32 additions and 33 deletions
+8 -9
View File
@@ -20,8 +20,8 @@ import open from 'open';
import path from 'node:path';
import { promises as fs } from 'node:fs';
import {
recordOnboardingStart,
recordOnboardingEnd,
recordGoogleAuthStart,
recordGoogleAuthEnd,
} from '../telemetry/metrics.js';
import type { Config } from '../config/config.js';
import {
@@ -115,9 +115,9 @@ async function initOauthClient(
authType: AuthType,
config: Config,
): Promise<AuthClient> {
const recordOnboardingEndIfApplicable = () => {
const recordGoogleAuthEndIfApplicable = () => {
if (authType === AuthType.LOGIN_WITH_GOOGLE) {
recordOnboardingEnd(config);
recordGoogleAuthEnd(config);
}
};
@@ -152,7 +152,7 @@ async function initOauthClient(
});
if (authType === AuthType.LOGIN_WITH_GOOGLE) {
recordOnboardingStart(config);
recordGoogleAuthStart(config);
}
const useEncryptedStorage = getUseEncryptedStorageFlag();
@@ -165,7 +165,6 @@ async function initOauthClient(
access_token: process.env['GOOGLE_CLOUD_ACCESS_TOKEN'],
});
await fetchAndCacheUserInfo(client);
recordOnboardingEndIfApplicable();
return client;
}
@@ -202,7 +201,7 @@ async function initOauthClient(
debugLogger.log('Loaded cached credentials.');
await triggerPostAuthCallbacks(credentials as Credentials);
recordOnboardingEndIfApplicable();
recordGoogleAuthEndIfApplicable();
return client;
}
} catch (error) {
@@ -287,7 +286,7 @@ async function initOauthClient(
}
await triggerPostAuthCallbacks(client.credentials);
recordOnboardingEndIfApplicable();
recordGoogleAuthEndIfApplicable();
} else {
// In Zed integration, we skip the interactive consent and directly open the browser
if (!config.getExperimentalZedIntegration()) {
@@ -394,7 +393,7 @@ async function initOauthClient(
});
await triggerPostAuthCallbacks(client.credentials);
recordOnboardingEndIfApplicable();
recordGoogleAuthEndIfApplicable();
}
return client;