relay count method didn't throw error
antonioconselheiro opened this issue · 3 comments
antonioconselheiro commented
alexgleason commented
You NEED to pass a signal to all methods when you use Nostrify. For example:
const { count } = await relay.count(filter, { signal: AbortSignal.timeout(1000) })
You need to pass a signal for all methods.
If you don't, Nostrify will wait forever. This is the expected and intended behavior.
There is no standardized way use a NOTICE
message to cancel a COUNT
automatically. For other methods, we listen for OK
and CLOSED
, but you should still specify an AbortSignal in case the relay doesn't return these.
antonioconselheiro commented
moved to an issue into strfry repo
alexgleason commented
I did not see until now that NIP-45 actually supports the CLOSED
verb, so I added support for it in NRelay1 here: https://gitlab.com/soapbox-pub/nostrify/-/merge_requests/105
Released in @nostrify/nostrify@0.36.1