candy-chat / candy

JavaScript-based multi-user chat client for XMPP.
http://candy-chat.github.io/candy
MIT License
1.32k stars 370 forks source link

New tab is created when user replies to your first message. #442

Open pavelsc opened 8 years ago

pavelsc commented 8 years ago

For example Alice and Bob connect to chat with: Candy.Core.connect(current_user.login + '@' + self.xmppDomain + '/Mycompany', current_user.token); Bob starts chat to Alice with: Candy.View.Pane.PrivateRoom.open(user.login + '@' + self.xmppDomain + '/Mycompany', user.login, true, true); Then new tab opens at Alice's side, and when she replies into this tab, the second tab with Alice opens at Bob's side where they can talk further. So Bob has two tabs with Alice. Is this a bug or is there a tricky way to fix that and receive messages in the tab opened first?

benlangfeld commented 8 years ago

Please provide full debug logs from both browsers.

pavelsc commented 8 years ago

So here is the log from B party (starting chat):

candy.bundle.js:214 [View:Pane:Roster] join
candy.bundle.js:214 [View:Pane:Roster] join
candy.bundle.js:246 [Strophe][DEBUG]: _throttledRequestHandler called with 1 requests
candy.bundle.js:246 [Strophe][DEBUG]: _processRequest: first request has readyState of 1
candy.bundle.js:246 [Strophe][DEBUG]: _throttledRequestHandler called with 2 requests
candy.bundle.js:246 [Strophe][DEBUG]: _processRequest: first request has readyState of 1
candy.bundle.js:246 [Strophe][DEBUG]: request id 21.0 posting
candy.bundle.js:246 [Strophe][DEBUG]: request id 21.0 state changed to 1
candy.bundle.js:214 SENT: <body rid='1488340528' xmlns='http://jabber.org/protocol/httpbind' sid='71d89a252875041578b668777b26d6ab95926f4f'><message to='user0001@chat.company.com/Company' from='pavelsc@chat.company.com/Company' type='chat' id='12' xmlns='jabber:client'><body>hi a</body><x xmlns='jabber:x:event'><composing/></x></message></body>
candy.bundle.js:246 [Strophe][DEBUG]: request id 20.1 state changed to 2
candy.bundle.js:246 [Strophe][DEBUG]: request id 20.1 state changed to 3
candy.bundle.js:246 [Strophe][DEBUG]: request id 20.1 state changed to 4
candy.bundle.js:246 [Strophe][DEBUG]: removing request
candy.bundle.js:246 [Strophe][DEBUG]: _throttledRequestHandler called with 1 requests
candy.bundle.js:246 [Strophe][DEBUG]: _processRequest: first request has readyState of 1
candy.bundle.js:246 [Strophe][DEBUG]: request id 20 should now be removed
candy.bundle.js:246 [Strophe][DEBUG]: request id 20.1 got 200
candy.bundle.js:246 [Strophe][INFO]: _dataRecv called
candy.bundle.js:214 RECV: <body xmlns='http://jabber.org/protocol/httpbind'/>
candy.bundle.js:246 [Strophe][DEBUG]: request id 21.1 state changed to 2
candy.bundle.js:246 [Strophe][DEBUG]: request id 21.1 state changed to 3
candy.bundle.js:246 [Strophe][DEBUG]: request id 21.1 state changed to 4
candy.bundle.js:246 [Strophe][DEBUG]: removing request
candy.bundle.js:246 [Strophe][DEBUG]: _throttledRequestHandler called with 0 requests
candy.bundle.js:246 [Strophe][DEBUG]: request id 21 should now be removed
candy.bundle.js:246 [Strophe][DEBUG]: request id 21.1 got 200
candy.bundle.js:246 [Strophe][INFO]: _dataRecv called
candy.bundle.js:214 RECV: <body xmlns='http://jabber.org/protocol/httpbind'><message xmlns='jabber:client' to='pavelsc@chat.company.com/Company' from='user0001@chat.company.com/Company' id='12' type='chat'><body>hi b</body><x xmlns='jabber:x:event'><composing/></x></message></body>
candy.bundle.js:214 [Jabber] Message
candy.bundle.js:214 [Jabber:Room] Message
candy.bundle.js:214 [View:Pane:Roster] join
candy.bundle.js:214 [View:Pane:Roster] join
candy.bundle.js:246 [Strophe][INFO]: no requests during idle cycle, sending blank request
candy.bundle.js:246 [Strophe][DEBUG]: _throttledRequestHandler called with 1 requests
candy.bundle.js:246 [Strophe][DEBUG]: request id 22.0 posting
candy.bundle.js:246 [Strophe][DEBUG]: request id 22.0 state changed to 1
candy.bundle.js:214 SENT: <body rid='1488340529' xmlns='http://jabber.org/protocol/httpbind' sid='71d89a252875041578b668777b26d6ab95926f4f'/>

And here is from A party:

candy.bundle.js:246 [Strophe][DEBUG]: request id 19.1 state changed to 2
candy.bundle.js:246 [Strophe][DEBUG]: request id 19.1 state changed to 3
candy.bundle.js:246 [Strophe][DEBUG]: request id 19.1 state changed to 4
candy.bundle.js:246 [Strophe][DEBUG]: removing request
candy.bundle.js:246 [Strophe][DEBUG]: _throttledRequestHandler called with 0 requests
candy.bundle.js:246 [Strophe][DEBUG]: request id 19 should now be removed
candy.bundle.js:246 [Strophe][DEBUG]: request id 19.1 got 200
candy.bundle.js:246 [Strophe][INFO]: _dataRecv called
candy.bundle.js:214 RECV: <body xmlns='http://jabber.org/protocol/httpbind'><message xmlns='jabber:client' to='user0001@chat.company.com/Company' from='pavelsc@chat.company.com/Company' id='12' type='chat'><body>hi a</body><x xmlns='jabber:x:event'><composing/></x></message></body>
candy.bundle.js:214 [Jabber] Message
candy.bundle.js:214 [Jabber:Room] Message
candy.bundle.js:214 [View:Pane:Roster] join
candy.bundle.js:214 [View:Pane:Roster] join
candy.bundle.js:246 [Strophe][INFO]: no requests during idle cycle, sending blank request
candy.bundle.js:246 [Strophe][DEBUG]: _throttledRequestHandler called with 1 requests
candy.bundle.js:246 [Strophe][DEBUG]: request id 20.0 posting
candy.bundle.js:246 [Strophe][DEBUG]: request id 20.0 state changed to 1
candy.bundle.js:214 SENT: <body rid='4115226850' xmlns='http://jabber.org/protocol/httpbind' sid='95c3be69817e515362f139c19da826e39b2c82ce'/>
candy.bundle.js:246 [Strophe][DEBUG]: _throttledRequestHandler called with 1 requests
candy.bundle.js:246 [Strophe][DEBUG]: _processRequest: first request has readyState of 1
candy.bundle.js:246 [Strophe][DEBUG]: _throttledRequestHandler called with 2 requests
candy.bundle.js:246 [Strophe][DEBUG]: _processRequest: first request has readyState of 1
candy.bundle.js:246 [Strophe][DEBUG]: request id 21.0 posting
candy.bundle.js:246 [Strophe][DEBUG]: request id 21.0 state changed to 1
candy.bundle.js:214 SENT: <body rid='4115226851' xmlns='http://jabber.org/protocol/httpbind' sid='95c3be69817e515362f139c19da826e39b2c82ce'><message to='pavelsc@chat.company.com/Company' from='user0001@chat.company.com/Company' type='chat' id='12' xmlns='jabber:client'><body>hi b</body><x xmlns='jabber:x:event'><composing/></x></message></body>
candy.bundle.js:246 [Strophe][DEBUG]: request id 20.1 state changed to 2
candy.bundle.js:246 [Strophe][DEBUG]: request id 20.1 state changed to 3
candy.bundle.js:246 [Strophe][DEBUG]: request id 20.1 state changed to 4
candy.bundle.js:246 [Strophe][DEBUG]: removing request
candy.bundle.js:246 [Strophe][DEBUG]: _throttledRequestHandler called with 1 requests
candy.bundle.js:246 [Strophe][DEBUG]: _processRequest: first request has readyState of 1
candy.bundle.js:246 [Strophe][DEBUG]: request id 20 should now be removed
candy.bundle.js:246 [Strophe][DEBUG]: request id 20.1 got 200
candy.bundle.js:246 [Strophe][INFO]: _dataRecv called
candy.bundle.js:214 RECV: <body xmlns='http://jabber.org/protocol/httpbind'/>