Open arthuro555 opened 2 years ago
i need too. and now i use setTimeout instead.
This also applies to the 'unavailable-id'
error (the reconnect case). That is, you have no context as to which peer the error relates to.
Responsible source code: https://github.com/peers/peerjs/blob/633cd84929f398899a06e8281706e3040410d706/lib/peer.ts#L390-L395
I think Promise-based API would make it easier to resolve this .
When a DataConnection fails to establish, for example, due to connecting to an invalid ID or to one's own ID, I would expect the
dataConnection.on('error', () => {...})
callback to be executed. Instead, onlypeer.on('error', () => {})
catches such kinds of errors. This is especially annoying when you want to for example connect to multiple peers at once since we cannot know which one has failed to connect, making it hard to tell the user which peer(s) has issues.