jiftechnify / nostr-fetch

A utility library that allows JS/TS apps to effortlessly fetch past events from Nostr relays.
MIT License
45 stars 2 forks source link

Infinite error loop on fetchLatestEventsPerAuthor #239

Closed SnowCait closed 5 months ago

SnowCait commented 6 months ago

fetchLatestEventsPerAuthor sometimes repeats to reconnect to relay and gets "WebSocket error". Then its iterator doesn't complete. The frequency of occurrence seems to increase in proportion to the number of authors.

Log (Deno): https://github.com/SnowCait/nostr-japanese-users/actions/runs/8283670090/job/22667396273#step:5:144

Reproduction code (Browser): https://github.com/SnowCait/svelte-sandbox/blob/92078b270e50cd5f9d3dad3b4eff3b7f382ea172/nostr-fetch/src/routes/%2Bpage.svelte

After reconnect, no REQs are published. image

I don't know if it's related, last REQ received no data. image

jiftechnify commented 5 months ago

The root cause of this issue was never ending fetchLatestEventsPerAuthor if authors array have duplicated pubkey. It should be fixed by #241.