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

If the relay reconnects,relay.subscribe executed again? #287

Open
asmcos opened this issue Dec 1, 2024 · 0 comments
Open

If the relay reconnects,relay.subscribe executed again? #287

asmcos opened this issue Dec 1, 2024 · 0 comments

Comments

@asmcos
Copy link

asmcos commented Dec 1, 2024

If the relay reconnects, should the subscription relay.subscribe(this, this.filters) be executed again?
` this.poolMonitor = (relay: NDKRelay) => {
// check if the pool monitor is already in the relayFilters
if (this.relayFilters?.has(relay.url)) return;

        const calc = calculateRelaySetsFromFilters(this.ndk, this.filters, this.pool);

        // check if the new relay is included
        if (calc.get(relay.url)) {
            // add it to the relayFilters
            this.relayFilters?.set(relay.url, this.filters);

            // d("New relay connected -- adding to subscription", relay.url);
            relay.subscribe(this, this.filters);
        }
    };`     

Will it return directly if (this.relayFilters?.has(relay.url))?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant