diff --git a/src/plus/subscription/subscriptionService.ts b/src/plus/subscription/subscriptionService.ts index 66702bd..8cde3d7 100644 --- a/src/plus/subscription/subscriptionService.ts +++ b/src/plus/subscription/subscriptionService.ts @@ -847,6 +847,9 @@ export class SubscriptionService implements Disposable { // Check the previous and new subscriptions are exactly the same const matches = previous != null && JSON.stringify(previous) === JSON.stringify(subscription); + // If the previous and new subscriptions are exactly the same, kick out + if (matches) return; + queueMicrotask(() => { this.container.telemetry.setGlobalAttributes({ 'account.id': subscription!.account?.id, @@ -889,15 +892,9 @@ export class SubscriptionService implements Disposable { : {}), }; - this.container.telemetry.sendEvent( - previous == null || matches ? 'subscription' : 'subscription/changed', - data, - ); + this.container.telemetry.sendEvent(previous == null ? 'subscription' : 'subscription/changed', data); }); - // If the previous and new subscriptions are exactly the same, kick out - if (matches) return; - void this.storeSubscription(subscription); this._subscription = subscription;