peerjs: unavailable-id after internet connection lost

Hey, this is how i reproduce this error:

if i close and re-open internet connection, it throws this error.

PeerJS:  WARNING You received a malformed message from undefined of type HTTP-ERROR peer.js:1117
PeerJS:  Socket open peer.js:1117
PeerJS:  ERROR Aborting. Error: ID `1` is taken peer.js:1117

and i dont use random ids generated from peerserver. a client’s peer id is always same and unique (i am getting it from user’s primary key value from database)

It is ok while i am switchinh between my web sites pages. (i put peer initialization code in my base.js which loads in every page) ,

swtiching between pages is a kind of disconnection from server right? but why does this happen only when internet connection lost?

i handle this error under peer.on('error'), although i write peer.destroy() here, i doesn’t work.

About this issue

  • Original URL
  • State: closed
  • Created 10 years ago
  • Reactions: 1
  • Comments: 33 (6 by maintainers)

Most upvoted comments

Anyone found a good solution yet? I’m using hardcoded ID’s to make it easy for people to connect to each other and store local data (about the other peer), so changing ID’s is not the nicest solution for me.

Does PeerJS is recommended for some major projects. As these kind of errors killing the project.

Its killing, what to do for the error

Same error NOT FIXED yet