Skip to content

Commit

Permalink
Merge pull request #1074 from WalletConnect/mixpanel
Browse files Browse the repository at this point in the history
[Notify] Add more logs
  • Loading branch information
llbartekll authored Sep 2, 2023
2 parents 1d08e85 + d89e0be commit fdbfd82
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 @@ -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<AppMetadata>(defaults: keyValueStorage, identifier: NotifyStorageIdntifiers.dappsMetadataStore)
let subscriptionScopeProvider = SubscriptionScopeProvider()
Expand Down

0 comments on commit fdbfd82

Please sign in to comment.