Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: introduce subscription manager #2202

Merged
merged 4 commits into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
browser:
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.48.0-jammy
image: mcr.microsoft.com/playwright:v1.50.0-jammy
env:
HOME: "/root"
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
timeout-minutes: 60
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.48.0-jammy
image: mcr.microsoft.com/playwright:v1.50.0-jammy
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
Expand Down
2 changes: 1 addition & 1 deletion packages/browser-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"test": "npx playwright test"
},
"devDependencies": {
"@playwright/test": "^1.48.1",
"@playwright/test": "^1.50.0",
"@waku/create-app": "^0.1.1-504bcd4",
"dotenv-flow": "^4.1.0",
"serve": "^14.2.3"
Expand Down
1 change: 0 additions & 1 deletion packages/sdk/src/protocols/filter/constants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export const DEFAULT_KEEP_ALIVE = 60_000;
export const DEFAULT_MAX_PINGS = 3;
export const DEFAULT_LIGHT_PUSH_FILTER_CHECK = false;
export const DEFAULT_LIGHT_PUSH_FILTER_CHECK_INTERVAL = 10_000;
12 changes: 0 additions & 12 deletions packages/sdk/src/protocols/filter/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import type {
IDecoder,
IFilter,
ILightPush,
IProtoMessage,
Libp2p,
PubsubTopic,
SubscribeResult,
Expand All @@ -25,7 +24,6 @@ import {

import { PeerManager } from "../peer_manager.js";

import { MessageCache } from "./message_cache.js";
import { Subscription } from "./subscription.js";
import { buildConfig } from "./utils.js";

Expand All @@ -35,7 +33,6 @@ class Filter implements IFilter {
public readonly protocol: FilterCore;

private readonly config: FilterProtocolOptions;
private readonly messageCache: MessageCache;
private activeSubscriptions = new Map<string, Subscription>();

public constructor(
Expand All @@ -46,7 +43,6 @@ class Filter implements IFilter {
config?: Partial<FilterProtocolOptions>
) {
this.config = buildConfig(config);
this.messageCache = new MessageCache(libp2p);

this.protocol = new FilterCore(
async (pubsubTopic, wakuMessage, peerIdStr) => {
Expand All @@ -58,14 +54,6 @@ class Filter implements IFilter {
return;
}

if (this.messageCache.has(pubsubTopic, wakuMessage as IProtoMessage)) {
log.info(
`Skipping duplicate message for pubsubTopic:${pubsubTopic} peerId:${peerIdStr}`
);
return;
}

this.messageCache.set(pubsubTopic, wakuMessage as IProtoMessage);
await subscription.processIncomingMessage(wakuMessage, peerIdStr);
},

Expand Down
53 changes: 0 additions & 53 deletions packages/sdk/src/protocols/filter/message_cache.ts

This file was deleted.

Loading
Loading