peerjs icon indicating copy to clipboard operation
peerjs copied to clipboard

Peer ID is already taken error

Open SujithManjavana opened this issue 2 years ago • 4 comments

My PeerId is unique as it contains my app's package name. When I end my call, I always run peer.destroy();, but I guess it’s not destroying properly on the peerjs cloud. Because if I try to call again within a few seconds after disconnecting the first call, I get an error that says my PeerID is already taken. How can I properly remove my PeerID from the cloud server after a call?

SujithManjavana avatar Jul 17 '22 07:07 SujithManjavana

Did you try with an own peerjs server? Maybe it is an error due to the library usage or something else than the cloud server id management.

kode-git avatar Jul 17 '22 11:07 kode-git

No I'm using peer server cloud.

On Sun, 17 Jul 2022, 5:08 pm Mario Sessa, @.***> wrote:

Did you try with an own peerjs server? Maybe it is an error due to the library usage or something else than the cloud server id management.

— Reply to this email directly, view it on GitHub https://github.com/peers/peerjs/issues/984#issuecomment-1186491507, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMJBKNACOYH6MRVS6RM7OGDVUPWB7ANCNFSM53ZKBIXA . You are receiving this because you authored the thread.Message ID: @.***>

SujithManjavana avatar Jul 17 '22 11:07 SujithManjavana

Update: it only occurs after peer.on("error", (err)

SujithManjavana avatar Jul 19 '22 13:07 SujithManjavana

There’s no way to manually remove an ID from the service because there’s no concept of ownership of IDs. But most errors should remove the client from the database instantaneously. If not, they will be removed periodically by a garbage collector.

Do you have any information on what errors cause the disconnect, @SujithManjavana?

jonasgloning avatar Aug 08 '22 11:08 jonasgloning