From 86ac5e47fa33a2c9be8f02d7057ca2b925de45b7 Mon Sep 17 00:00:00 2001 From: OFF0 Date: Sat, 22 Jul 2023 18:48:25 +0200 Subject: [PATCH] feed: fix too many subscriptions fetch profile meta data only for future notes for pubkeys that are not known of if the event kind is a text note, but not for reactions or meta data. this drastically reduces one time subscriptions. --- src/subscriptions.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/subscriptions.ts b/src/subscriptions.ts index 4dd408a..838e2ef 100644 --- a/src/subscriptions.ts +++ b/src/subscriptions.ts @@ -59,6 +59,12 @@ export const sub24hFeed = (onEvent: SubCallback) => { sub({ cb: (evt, relay) => { onEvent(evt, relay); + if ( + evt.kind !== 1 + || pubkeys.has(evt.pubkey) + ) { + return; + } subOnce({ // get profil data relay, cb: onEvent,