Pass session down so we can avoid a network call (#181570)

We don't need to fetch the user details when the Auth Session already has the info we need. This PR removes that extraneous web request.

I've also changed the `User-Agent` that we pass to be more specific so we can narrow down any future issues with spamming web requests.

Fixes #173645
This commit is contained in:
Tyler James Leonhardt
2023-05-04 11:59:25 -07:00
committed by GitHub
parent e4bb8fa827
commit f9b4b4c6a3
2 changed files with 17 additions and 27 deletions

View File

@@ -110,7 +110,7 @@ export class GitHubAuthenticationProvider implements vscode.AuthenticationProvid
// We only want to fire a telemetry if we haven't seen this account yet in this session.
if (!this._accountsSeen.has(session.account.id)) {
this._accountsSeen.add(session.account.id);
this._githubServer.sendAdditionalTelemetryInfo(session.accessToken);
this._githubServer.sendAdditionalTelemetryInfo(session);
}
}