We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cf07e34 commit e6fa06eCopy full SHA for e6fa06e
packages/logging/src/analytics-helpers.ts
@@ -272,8 +272,11 @@ export class ThrottledAnalytics implements MongoshAnalytics {
272
273
identify(message: AnalyticsIdentifyMessage): void {
274
message = addTimestamp(message);
275
- if (this.currentUserId) {
276
- throw new Error('Identify can only be called once per user session');
+
+ if (this.currentUserId && !message.deviceId) {
277
+ throw new Error(
278
+ 'Identifying without device ID can only be called once per user session'
279
+ );
280
}
281
this.currentUserId = message.userId ?? message.anonymousId;
282
this.restorePromise = this.restoreThrottleState().then((enabled) => {
0 commit comments