diff --git a/packages/sdk/src/protocols/filter/index.ts b/packages/sdk/src/protocols/filter/index.ts index f78e4d8ae7..07e7ec7876 100644 --- a/packages/sdk/src/protocols/filter/index.ts +++ b/packages/sdk/src/protocols/filter/index.ts @@ -26,7 +26,7 @@ import { import { PeerManager } from "../peer_manager.js"; import { MessageCache } from "./message_cache.js"; -import { SubscriptionManager } from "./subscription_manager.js"; +import { Subscription } from "./subscription.js"; import { buildConfig } from "./utils.js"; const log = new Logger("sdk:filter"); @@ -36,7 +36,7 @@ class Filter implements IFilter { private readonly config: FilterProtocolOptions; private readonly messageCache: MessageCache; - private activeSubscriptions = new Map(); + private activeSubscriptions = new Map(); public constructor( private connectionManager: ConnectionManager, @@ -186,7 +186,7 @@ class Filter implements IFilter { this.getActiveSubscription(pubsubTopic) ?? this.setActiveSubscription( pubsubTopic, - new SubscriptionManager( + new Subscription( pubsubTopic, this.protocol, this.connectionManager, @@ -263,17 +263,16 @@ class Filter implements IFilter { return toAsyncIterator(this, decoders); } - //TODO: move to SubscriptionManager private getActiveSubscription( pubsubTopic: PubsubTopic - ): SubscriptionManager | undefined { + ): Subscription | undefined { return this.activeSubscriptions.get(pubsubTopic); } private setActiveSubscription( pubsubTopic: PubsubTopic, - subscription: SubscriptionManager - ): SubscriptionManager { + subscription: Subscription + ): Subscription { this.activeSubscriptions.set(pubsubTopic, subscription); return subscription; } diff --git a/packages/sdk/src/protocols/filter/subscription_manager.ts b/packages/sdk/src/protocols/filter/subscription.ts similarity index 99% rename from packages/sdk/src/protocols/filter/subscription_manager.ts rename to packages/sdk/src/protocols/filter/subscription.ts index 21bc45a446..3534f26a7f 100644 --- a/packages/sdk/src/protocols/filter/subscription_manager.ts +++ b/packages/sdk/src/protocols/filter/subscription.ts @@ -36,7 +36,7 @@ import { DEFAULT_LIGHT_PUSH_FILTER_CHECK_INTERVAL } from "./constants.js"; const log = new Logger("sdk:filter:subscription_manager"); -export class SubscriptionManager implements ISubscription { +export class Subscription implements ISubscription { private reliabilityMonitor: ReceiverReliabilityMonitor; private keepAliveTimeout: number;