From d89e0bec0de8bab35d4429a997d8837bc4b6ec0c Mon Sep 17 00:00:00 2001 From: Bartosz Rozwarski Date: Sat, 2 Sep 2023 12:40:48 +0100 Subject: [PATCH] add more logs --- .../Client/Common/NotifyResubscribeService.swift | 5 ++++- .../Client/Wallet/NotifyClientFactory.swift | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Sources/WalletConnectNotify/Client/Common/NotifyResubscribeService.swift b/Sources/WalletConnectNotify/Client/Common/NotifyResubscribeService.swift index 4d48f7a7c..80fbd12ec 100644 --- a/Sources/WalletConnectNotify/Client/Common/NotifyResubscribeService.swift +++ b/Sources/WalletConnectNotify/Client/Common/NotifyResubscribeService.swift @@ -4,13 +4,15 @@ import Combine final class NotifyResubscribeService { private var publishers = Set() + private let logger: ConsoleLogging private let networkInteractor: NetworkInteracting private let notifyStorage: NotifyStorage - init(networkInteractor: NetworkInteracting, notifyStorage: NotifyStorage) { + init(networkInteractor: NetworkInteracting, notifyStorage: NotifyStorage, logger: ConsoleLogging) { self.networkInteractor = networkInteractor self.notifyStorage = notifyStorage + self.logger = logger setUpResubscription() } @@ -19,6 +21,7 @@ final class NotifyResubscribeService { .sink { [unowned self] status in guard status == .connected else { return } let topics = notifyStorage.getSubscriptions().map{$0.topic} + logger.debug("Resubscribing to notify subscription topics: \(topics)", properties: ["topics": topics.joined(separator: ", ")]) Task(priority: .high) { try await networkInteractor.batchSubscribe(topics: topics) } diff --git a/Sources/WalletConnectNotify/Client/Wallet/NotifyClientFactory.swift b/Sources/WalletConnectNotify/Client/Wallet/NotifyClientFactory.swift index 2e15e4266..f032473cc 100644 --- a/Sources/WalletConnectNotify/Client/Wallet/NotifyClientFactory.swift +++ b/Sources/WalletConnectNotify/Client/Wallet/NotifyClientFactory.swift @@ -48,7 +48,7 @@ public struct NotifyClientFactory { let notifyMessageSubscriber = NotifyMessageSubscriber(keyserver: keyserverURL, networkingInteractor: networkInteractor, identityClient: identityClient, notifyStorage: notifyStorage, crypto: crypto, logger: logger) let webDidResolver = WebDidResolver() let deleteNotifySubscriptionService = DeleteNotifySubscriptionService(keyserver: keyserverURL, networkingInteractor: networkInteractor, identityClient: identityClient, webDidResolver: webDidResolver, kms: kms, logger: logger, notifyStorage: notifyStorage) - let resubscribeService = NotifyResubscribeService(networkInteractor: networkInteractor, notifyStorage: notifyStorage) + let resubscribeService = NotifyResubscribeService(networkInteractor: networkInteractor, notifyStorage: notifyStorage, logger: logger) let dappsMetadataStore = CodableStore(defaults: keyValueStorage, identifier: NotifyStorageIdntifiers.dappsMetadataStore) let subscriptionScopeProvider = SubscriptionScopeProvider()