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 4a2724fd6..cb77bce9a 100644 --- a/Sources/WalletConnectNotify/Client/Wallet/NotifyClientFactory.swift +++ b/Sources/WalletConnectNotify/Client/Wallet/NotifyClientFactory.swift @@ -41,7 +41,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()