Skip to content

Commit a835608

Browse files
authored
fix(compass): remove userId from telemetry calls MONGOSH-7609 (#5430)
* fix(compass): remove userId from telemetry calls MONGOSH-7609 * more cleanup
1 parent 3553e6c commit a835608

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

packages/compass/src/main/telemetry.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ class CompassTelemetry {
3535
private static analytics: Analytics | null = null;
3636
private static state: 'enabled' | 'disabled' = 'disabled';
3737
private static queuedEvents: EventInfo[] = []; // Events that happen before we fetch user preferences
38-
private static currentUserId?: string; // Deprecated field. Should be used only for old users to keep their analytics in Segment.
3938
private static telemetryAnonymousId = ''; // The randomly generated anonymous user id.
4039
private static lastReportedScreen = '';
4140
private static osInfo: ReturnType<typeof getOsInfo> extends Promise<infer T>
@@ -80,7 +79,6 @@ class CompassTelemetry {
8079
}
8180

8281
this.analytics.track({
83-
userId: this.currentUserId,
8482
anonymousId: this.telemetryAnonymousId,
8583
event: info.event,
8684
properties: { ...info.properties, ...commonProperties },
@@ -96,7 +94,6 @@ class CompassTelemetry {
9694
{
9795
telemetryCapableEnvironment,
9896
hasAnalytics: !!this.analytics,
99-
currentUserId: this.currentUserId,
10097
telemetryAnonymousId: this.telemetryAnonymousId,
10198
state: this.state,
10299
queuedEvents: this.queuedEvents.length,
@@ -108,7 +105,6 @@ class CompassTelemetry {
108105
this.telemetryAnonymousId
109106
) {
110107
this.analytics.identify({
111-
userId: this.currentUserId,
112108
anonymousId: this.telemetryAnonymousId,
113109
traits: {
114110
...this._getCommonProperties(),
@@ -131,9 +127,8 @@ class CompassTelemetry {
131127

132128
private static async _init(app: typeof CompassApplication) {
133129
const { preferences } = app;
134-
const { trackUsageStatistics, currentUserId, telemetryAnonymousId } =
130+
const { trackUsageStatistics, telemetryAnonymousId } =
135131
preferences.getPreferences();
136-
this.currentUserId = currentUserId;
137132
this.telemetryAnonymousId = telemetryAnonymousId ?? '';
138133

139134
try {

0 commit comments

Comments
 (0)