Skip to content

Commit 1063c31

Browse files
committed
log provider id
1 parent 9fee800 commit 1063c31

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/vs/workbench/services/userDataSync/browser/userDataSyncWorkbenchService.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import { UserDataSyncStoreTypeSynchronizer } from 'vs/platform/userDataSync/comm
3737

3838
type UserAccountClassification = {
3939
id: { classification: 'EndUserPseudonymizedInformation', purpose: 'BusinessInsight' };
40+
providerId: { classification: 'EndUserPseudonymizedInformation', purpose: 'BusinessInsight' };
4041
};
4142

4243
type FirstTimeSyncClassification = {
@@ -45,6 +46,7 @@ type FirstTimeSyncClassification = {
4546

4647
type UserAccountEvent = {
4748
id: string;
49+
providerId: string;
4850
};
4951

5052
type FirstTimeSyncAction = 'pull' | 'push' | 'merge' | 'manual';
@@ -519,18 +521,20 @@ export class UserDataSyncWorkbenchService extends Disposable implements IUserDat
519521
if (!result) {
520522
return false;
521523
}
522-
let sessionId: string, accountName: string, accountId: string;
524+
let sessionId: string, accountName: string, accountId: string, authenticationProviderId: string;
523525
if (isAuthenticationProvider(result)) {
524526
const session = await this.authenticationService.createSession(result.id, result.scopes);
525527
sessionId = session.id;
526528
accountName = session.account.label;
527529
accountId = session.account.id;
530+
authenticationProviderId = result.id;
528531
} else {
529532
sessionId = result.sessionId;
530533
accountName = result.accountName;
531534
accountId = result.accountId;
535+
authenticationProviderId = result.authenticationProviderId;
532536
}
533-
await this.switch(sessionId, accountName, accountId);
537+
await this.switch(sessionId, accountName, accountId, authenticationProviderId);
534538
return true;
535539
}
536540

@@ -604,13 +608,13 @@ export class UserDataSyncWorkbenchService extends Disposable implements IUserDat
604608
return quickPickItems;
605609
}
606610

607-
private async switch(sessionId: string, accountName: string, accountId: string): Promise<void> {
611+
private async switch(sessionId: string, accountName: string, accountId: string, authenticationProviderId: string): Promise<void> {
608612
const currentAccount = this.current;
609613
if (this.userDataAutoSyncEnablementService.isEnabled() && (currentAccount && currentAccount.accountName !== accountName)) {
610614
// accounts are switched while sync is enabled.
611615
}
612616
this.currentSessionId = sessionId;
613-
this.telemetryService.publicLog2<UserAccountEvent, UserAccountClassification>('sync.userAccount', { id: accountId });
617+
this.telemetryService.publicLog2<UserAccountEvent, UserAccountClassification>('sync.userAccount', { id: accountId, providerId: authenticationProviderId });
614618
await this.update();
615619
}
616620

0 commit comments

Comments
 (0)