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

Make sure connectPeer rejects when peer is not available #4

Merged
merged 3 commits into from
Jun 6, 2024

Conversation

louwers
Copy link
Contributor

@louwers louwers commented May 26, 2024

connectPeer will never be fulfilled if the peer does not respond. This is because the error is sent to the peer, not to the connection. This PR fixes that. Extracting the peer from the message is not the most elegant solution, but there's no more reliable way to extract the peer id. If this check is removed the Promise can be rejected in response to the connection to another peer failing.

I updated peerjs because the PeerError class is new in 1.5.0.

See also peers/peerjs#1281

src/helpers/peer.ts Outdated Show resolved Hide resolved
@louwers louwers changed the title Make sure connectPeer resolves when peer is not available Make sure connectPeer fulfills when peer is not available May 26, 2024
@louwers louwers changed the title Make sure connectPeer fulfills when peer is not available Make sure connectPeer rejects when peer is not available May 26, 2024
@chidokun chidokun merged commit b8c2178 into chidokun:main Jun 6, 2024
1 check passed
@chidokun
Copy link
Owner

chidokun commented Jun 6, 2024

Thank you for your contributions!

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

Successfully merging this pull request may close these issues.

2 participants