Creating two Peers one after the other causes HTTP-ERROR #2

Closed
michelle opened this Issue Mar 6, 2013 · 6 comments

Projects

None yet

2 participants

@michelle
Member
michelle commented Mar 6, 2013

To reproduce: Go to chat.html, enter the following in console:

peer = new Peer({ key: 'lwjd5qra8257b9', debug: true }); peer2 = new Peer({ key: 'lwjd5qra8257b9', debug: true });

@michelle
Member
michelle commented Mar 6, 2013

@ericz Any ideas off the top of your head? Seems either token is conflicting or MongoDB error.

@ericz
Member
ericz commented Mar 6, 2013

When opening connection with XHR, if ID is taken, HTTP-ERROR is emitted
instead of ID-TAKEN. Only websocket emits ID-taken. this is so people don't
get two ID taken messages when connection.

2nd connection in your examples gets the HTTP-ERROR because id is taken.

On Wed, Mar 6, 2013 at 1:12 AM, Michelle Bu notifications@github.comwrote:

@ericz https://github.com/ericz Any ideas off the top of your head?
Seems either token is conflicting or MongoDB error.


Reply to this email directly or view it on GitHubhttps://github.com/peers/peerjs-server/issues/2#issuecomment-14489376
.

510-691-3951
http://ericzhang.com

@michelle
Member
michelle commented Mar 6, 2013

But no ID is passed in for the second Peer, so the server should assign one that isn't taken. This is still a pretty bad bug IMO, since I can't create multiple Peers at the same time. And I never get an ID-TAKEN message either.

This problem does not happen if I create peer2 on the open event of peer1.

@ericz
Member
ericz commented Mar 6, 2013

oh shit didnt realize no id was passed in

On Wed, Mar 6, 2013 at 1:29 AM, Michelle Bu notifications@github.comwrote:

But no ID is passed in for the second Peer, so the server should assign
one that isn't taken. This is still a pretty bad bug IMO, since I can't
create multiple Peers at the same time. And I never get an ID-TAKEN message
either.

This problem does not happen if I create peer2 on the open event of peer1.


Reply to this email directly or view it on GitHubhttps://github.com/peers/peerjs-server/issues/2#issuecomment-14490041
.

510-691-3951
http://ericzhang.com

@michelle
Member
michelle commented Mar 6, 2013

Yeah I will look into it more.

@ericz
Member
ericz commented Mar 6, 2013

It looks like the /id GET request that asks the server for ID is being
cached.

Need to send explicity cache control headers from server in /id response to
prevent caching

On Wed, Mar 6, 2013 at 1:30 AM, Eric Zhang really.ez@gmail.com wrote:

oh shit didnt realize no id was passed in

On Wed, Mar 6, 2013 at 1:29 AM, Michelle Bu notifications@github.comwrote:

But no ID is passed in for the second Peer, so the server should assign
one that isn't taken. This is still a pretty bad bug IMO, since I can't
create multiple Peers at the same time. And I never get an ID-TAKEN message
either.

This problem does not happen if I create peer2 on the open event of peer1
.


Reply to this email directly or view it on GitHubhttps://github.com/peers/peerjs-server/issues/2#issuecomment-14490041
.

510-691-3951
http://ericzhang.com

510-691-3951
http://ericzhang.com

@michelle michelle closed this Mar 6, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment