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

Manipulating end of subscription event #238

Open
maksmachado opened this issue Jun 28, 2023 · 3 comments
Open

Manipulating end of subscription event #238

maksmachado opened this issue Jun 28, 2023 · 3 comments

Comments

@maksmachado
Copy link

Hello, I have some code that should only start when the entire subscription event is finished, so I placed this code inside the 'eose' event. However, I noticed that the 'eose' event, when using a relay pool, is being called more than once when there are relays with connection errors.
My question is if there is another way to wait for the end of the subscription event.

@fiatjaf
Copy link
Collaborator

fiatjaf commented Jun 29, 2023

I think this library is not flexible or powerful enough, you should try using https://github.com/nostr-dev-kit/ndk or https://www.npmjs.com/package/@snort/system instead.

@maksmachado
Copy link
Author

maksmachado commented Jun 29, 2023

I don't think that's it. I believe it's just me not knowing how to use the tool correctly, and I thought I could find the answers here, but I guess I was mistaken.
I did some more tests today, and the event "eose" triggered only once, even with connection errors. I really don't know if in my previous code I was calling the event more than once.

@Egge21M
Copy link
Contributor

Egge21M commented Aug 31, 2023

Please be aware that Pool will fake an EOSE event after 3400ms (or whenever specified), even if not all events have been received yet.

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

3 participants