Closed alexgleason closed 8 months ago
I published nostr-relaypool2
on npm and now it does the correct thing:
Feb 02 22:50:28 gleasonator deno[904365]: Unhandled message from worker: { type: "error", err: undefined, relayUrl: "wss://relay.current.fyi/" }
Feb 02 22:50:28 gleasonator deno[904365]: Unhandled message from worker: { type: "error", err: {}, relayUrl: "wss://relay.current.fyi/" }
Feb 02 22:50:28 gleasonator deno[904365]: Unhandled message from worker: { type: "error", err: undefined, relayUrl: "wss://relay.current.fyi/" }
Feb 02 22:50:30 gleasonator deno[904365]: wss://relay.current.fyi/ reconnecting after 6s
Feb 02 22:50:30 gleasonator deno[904365]: wss://relay.current.fyi/ reconnecting after 18s
Feb 02 22:50:30 gleasonator deno[904365]: Unhandled message from worker: { type: "error", err: undefined, relayUrl: "wss://relay.current.fyi/" }
Feb 02 22:50:30 gleasonator deno[904365]: Unhandled message from worker: { type: "error", err: undefined, relayUrl: "wss://relay.current.fyi/" }
Feb 02 22:50:38 gleasonator deno[904365]: warning: Use of deprecated "Deno.writeSync()" API. This API will be removed in Deno 2. Run again with DENO_VERBOSE_WARNINGS=1 to get more details.
Feb 02 22:50:38 gleasonator deno[904365]: warning: Use of deprecated "Deno.close()" API. This API will be removed in Deno 2. Run again with DENO_VERBOSE_WARNINGS=1 to get more details.
Feb 02 22:50:48 gleasonator deno[904365]: wss://relay.current.fyi/ reconnecting after 54s
Feb 02 22:50:48 gleasonator deno[904365]: wss://relay.current.fyi/ reconnecting after 162s
Feb 02 22:50:48 gleasonator deno[904365]: wss://relay.current.fyi/ reconnecting after 486s
Feb 02 22:50:48 gleasonator deno[904365]: wss://relay.current.fyi/ reconnecting after 1458s
Feb 02 22:50:48 gleasonator deno[904365]: Unhandled message from worker: { type: "error", err: undefined, relayUrl: "wss://relay.current.fyi/" }
Feb 02 22:50:48 gleasonator deno[904365]: Unhandled message from worker: { type: "error", err: undefined, relayUrl: "wss://relay.current.fyi/" }
Feb 02 22:50:48 gleasonator deno[904365]: Unhandled message from worker: { type: "error", err: undefined, relayUrl: "wss://relay.current.fyi/" }
Feb 02 22:50:48 gleasonator deno[904365]: Unhandled message from worker: { type: "error", err: undefined, relayUrl: "wss://relay.current.fyi/" }
Thanks!
I am encountering the following error:
It's because in the
reconnect
code path, it callsconnect()
but does not catch it.connect()
can reject, becauseconnectRelay()
can reject, and in fact has specific places where it does it:So if a relay tries to reconnect and then it encounters an error while opening the socket, it will not queue it to be reconnected again, and will instead kill the whole application.
The solution is to call
this.#reconnect()
again, letting the reconnectTimeout do its job.