Skip to content

Commit

Permalink
add more logs
Browse files Browse the repository at this point in the history
  • Loading branch information
llbartekll committed Sep 2, 2023
1 parent d28e88c commit d89e0be
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ import Combine
final class NotifyResubscribeService {

private var publishers = Set<AnyCancellable>()
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()
}

Expand All @@ -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)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<AppMetadata>(defaults: keyValueStorage, identifier: NotifyStorageIdntifiers.dappsMetadataStore)
let subscriptionScopeProvider = SubscriptionScopeProvider()
Expand Down

0 comments on commit d89e0be

Please sign in to comment.