question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug: peerclose fires without emitting peerconnect

See original GitHub issue

If a peer fails to connect [not sure why that happens yet], it will emit close, without ever emitting peerconnect

This case needs to be considered

code:

const map = {}
p2pcf.on('peerconnect', peer => {
  map[peer.id] = true
})
p2pcf.on('peerclose', peer => {
  if (map[peer.id]) {
    // handle
  } else {
    // this should never occur but does
  }
})

should there be a separate event for failed to init peer?

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:15 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
ThaUnknowncommented, Aug 3, 2022

can you describe in more detail what change is occurring that is triggering it and why?

console.error('network change', newUdpEnabled !== this.udpEnabled, newIsSymmetric !== this.isSymmetric, newDtlsFingerprint !== this.dtlsFingerprint, !retainedAnyReflexiveIps)

yielded true, false, false, true, but this is a sample size 1 of 10, so take it with a grain of salt the end user was doing nothing, just sitting there watching console, no interactions with the app or OS, no other [significant] apps in the background etc

Oh and we can probably not drop the peers that are connected via TURN. Is the peer whose IP changed on a symmetric NAT?

Their IP didn’t change, and I’m not sure

The reason I wanted a peerstart or peercreate event is because there’s no way for me to listen to ice state events from p2pcf without modifying it

0reactions
gfodorcommented, Aug 4, 2022

I think this issue should be fixed now so going to close. If another scenario comes up where it’s desirable to have additional events regarding peer state please open another one - I will be probably updating start() to both await on the initial POST response and return a data structure describing the state of the room wrt existing peers.

Read more comments on GitHub >

github_iconTop Results From Across the Web

call.on("close") not triggered · Issue #636 · peers/peerjs - GitHub
I found a way that worked for me, I'm using peerjs alongside socket.io, so when i kill the call by peer.close(), I then...
Read more >
Why am I missing events from fromEvent? - Stack Overflow
I think I've solved this. The problem appears to be that any elements that, if the peer emits 'connnection' before it emits 'open', ......
Read more >
Relay - Go Packages
ion-sfu supports relaying tracks to other ion-SFUs or other services using the ORTC API. Using this api allows to quickly send the stream...
Read more >
rpep - npm
2.0.1 - Fixing bug where emitted errors were silently ignored if no listeners were attached to an RPEP connection or server. 2.0.0 -...
Read more >
JavaScript SDK | API Reference - SkyWay
SkyWay is a multi-platform SDK that allows you to easily implement video and voice calling functionality.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found