From 351e18f6389c2dbaa2107e6549be9928c2e8834f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karol=20S=C3=B3jko?= Date: Mon, 15 Jan 2024 11:06:19 +0100 Subject: [PATCH] fix(auth): add debug logs for subscription sync requested event --- .../SubscriptionSyncRequestedEventHandler.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/packages/auth/src/Domain/Handler/SubscriptionSyncRequestedEventHandler.ts b/packages/auth/src/Domain/Handler/SubscriptionSyncRequestedEventHandler.ts index affd1549a..84c99e6c3 100644 --- a/packages/auth/src/Domain/Handler/SubscriptionSyncRequestedEventHandler.ts +++ b/packages/auth/src/Domain/Handler/SubscriptionSyncRequestedEventHandler.ts @@ -33,6 +33,10 @@ export class SubscriptionSyncRequestedEventHandler implements DomainEventHandler ) {} async handle(event: SubscriptionSyncRequestedEvent): Promise { + this.logger.info('Subscription sync requested', { + subscriptionId: event.payload.subscriptionId, + }) + if (event.payload.offline) { const offlineUserSubscription = await this.createOrUpdateOfflineSubscription( event.payload.subscriptionId, @@ -78,6 +82,11 @@ export class SubscriptionSyncRequestedEventHandler implements DomainEventHandler return } + this.logger.info('Syncing subscription', { + userId: user.uuid, + subscriptionId: event.payload.subscriptionId, + }) + const userSubscription = await this.createOrUpdateSubscription( event.payload.subscriptionId, event.payload.subscriptionName, @@ -122,6 +131,11 @@ export class SubscriptionSyncRequestedEventHandler implements DomainEventHandler if (result.isFailed()) { this.logger.error(`Could not set extension key for user ${user.uuid}`) } + + this.logger.info('Subscription synced', { + userId: user.uuid, + subscriptionId: event.payload.subscriptionId, + }) } private async createOrUpdateSubscription(