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

Empty chat tabs when using multiple rooms (autojoin) #105

Closed oxivanisher closed 12 years ago

oxivanisher commented 12 years ago

Hi There :)

i can't figure out why this is not working. if i autoconnect to one room only, its working fine.

-- snip log --

[Init] Debugging enabled
[Connection] Connecting
SENT: <body rid='925589' xmlns='http://jabber.org/protocol/httpbind' to='public.oxi.ch' xml:lang='en' wait='60' hold='1' content='text/xml; charset=utf-8' ver='1.6' xmpp:version='1.0' xmlns:xmpp='urn:xmpp:xbosh'/>
RECV: <body xmlns='http://jabber.org/protocol/httpbind' xmlns:xmpp='urn:xmpp:xbosh' xmlns:stream='http://etherx.jabber.org/streams' sid='7dbd87333d55ef3f73306290ff28a3d637132618' wait='60' requests='2' inactivity='30' maxpause='120' polling='2' ver='1.8' from='public.oxi.ch' secure='true' authid='1601955137' xmpp:version='1.0'><stream:features xmlns:stream='http://etherx.jabber.org/streams'><mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>SCRAM-SHA-1</mechanism><mechanism>ANONYMOUS</mechanism><mechanism>DIGEST-MD5</mechanism><mechanism>PLAIN</mechanism></mechanisms><c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='http://www.process-one.net/en/ejabberd/' ver='TQ2JFyRoSa70h2G1bpgjzuXb2sU='/><register xmlns='http://jabber.org/features/iq-register'/></stream:features></body>
[Connection] Authenticating
SENT: <body rid='925590' xmlns='http://jabber.org/protocol/httpbind' sid='7dbd87333d55ef3f73306290ff28a3d637132618'><auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='ANONYMOUS'/></body>
RECV: <body xmlns='http://jabber.org/protocol/httpbind'><success xmlns='urn:ietf:params:xml:ns:xmpp-sasl'/></body>
SENT: <body rid='925591' xmlns='http://jabber.org/protocol/httpbind' sid='7dbd87333d55ef3f73306290ff28a3d637132618' to='public.oxi.ch' xml:lang='en' xmpp:restart='true' xmlns:xmpp='urn:xmpp:xbosh'/>
RECV: <body xmlns='http://jabber.org/protocol/httpbind' xmlns:xmpp='urn:xmpp:xbosh' xmlns:stream='http://etherx.jabber.org/streams' sid='7dbd87333d55ef3f73306290ff28a3d637132618' wait='60' requests='2' inactivity='30' maxpause='120' polling='2' ver='1.8' from='public.oxi.ch' secure='true' authid='1535251040' xmpp:version='1.0'><stream:features xmlns:stream='http://etherx.jabber.org/streams'><bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'/><session xmlns='urn:ietf:params:xml:ns:xmpp-session'/><c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='http://www.process-one.net/en/ejabberd/' ver='TQ2JFyRoSa70h2G1bpgjzuXb2sU='/><register xmlns='http://jabber.org/features/iq-register'/></stream:features></body>
SENT: <body rid='925592' xmlns='http://jabber.org/protocol/httpbind' sid='7dbd87333d55ef3f73306290ff28a3d637132618'><iq type='set' id='_bind_auth_2' xmlns='jabber:client'><bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'><resource>Candy</resource></bind></iq></body>
RECV: <body xmlns='http://jabber.org/protocol/httpbind'><iq xmlns='jabber:client' id='_bind_auth_2' type='result'><bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'><jid>28827123041340466382681495@public.oxi.ch/Candy</jid></bind></iq></body>
SENT: <body rid='925593' xmlns='http://jabber.org/protocol/httpbind' sid='7dbd87333d55ef3f73306290ff28a3d637132618'><iq type='set' id='_session_auth_2' xmlns='jabber:client'><session xmlns='urn:ietf:params:xml:ns:xmpp-session'/></iq></body>
RECV: <body xmlns='http://jabber.org/protocol/httpbind'><iq xmlns='jabber:client' type='result' id='_session_auth_2'><session xmlns='urn:ietf:params:xml:ns:xmpp-session'/></iq></body>
[Connection] Connected
[Jabber] Anonymous login
[Connection] Attached
SENT: <body rid='925594' xmlns='http://jabber.org/protocol/httpbind' sid='7dbd87333d55ef3f73306290ff28a3d637132618'><presence xmlns='jabber:client'/><iq type='get' from='28827123041340466382681495@public.oxi.ch/Candy' to='plaudern@conference.oxi.ch' id='disco3' xmlns='jabber:client'><query xmlns='http://jabber.org/protocol/disco#info'/></iq><presence from='28827123041340466382681495@public.oxi.ch/Candy' to='plaudern@conference.oxi.ch/admin' xmlns='jabber:client'><x xmlns='http://jabber.org/protocol/muc'/></presence><iq type='get' from='28827123041340466382681495@public.oxi.ch/Candy' to='braingoo@conference.oxi.ch' id='disco3' xmlns='jabber:client'><query xmlns='http://jabber.org/protocol/disco#info'/></iq><presence from='28827123041340466382681495@public.oxi.ch/Candy' to='braingoo@conference.oxi.ch/admin' xmlns='jabber:client'><x xmlns='http://jabber.org/protocol/muc'/></presence><iq type='get' from='28827123041340466382681495@public.oxi.ch/Candy' to='mmojunkies@conference.oxi.ch' id='disco3' xmlns='jabber:client'><query xmlns='http://jabber.org/protocol/disco#info'/></iq><presence from='28827123041340466382681495@public.oxi.ch/Candy' to='mmojunkies@conference.oxi.ch/admin' xmlns='jabber:client'><x xmlns='http://jabber.org/protocol/muc'/></presence><iq type='get' from='28827123041340466382681495@public.oxi.ch/Candy' id='get1' xmlns='jabber:client'><query xmlns='jabber:iq:privacy'><list name='ignore'/></query></iq></body>
GET http://stats.jtvnw.net:1935/crossdomain.xml  stats.jtvnw.net:1935/crossdomain.xml:1
RECV: <body xmlns='http://jabber.org/protocol/httpbind'><presence xmlns='jabber:client' from='28827123041340466382681495@public.oxi.ch/Candy' to='28827123041340466382681495@public.oxi.ch/Candy'/><iq xmlns='jabber:client' from='28827123041340466382681495@public.oxi.ch' to='28827123041340466382681495@public.oxi.ch/Candy' id='get1' type='error'><query xmlns='jabber:iq:privacy'><list name='ignore'/></query><error code='404' type='cancel'><item-not-found xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/></error></iq><iq xmlns='jabber:client' from='plaudern@conference.oxi.ch' to='28827123041340466382681495@public.oxi.ch/Candy' id='disco3' type='result'><query xmlns='http://jabber.org/protocol/disco#info'><identity category='conference' type='text' name='Plaudern'/><feature var='http://jabber.org/protocol/muc'/><feature var='muc_hidden'/><feature var='muc_persistent'/><feature var='muc_open'/><feature var='muc_nonanonymous'/><feature var='muc_moderated'/><feature var='muc_unsecured'/><x xmlns='jabber:x:data' type='result'><field type='hidden' var='FORM_TYPE'><value>http://jabber.org/protocol/muc#roominfo</value></field><field label='Room description' var='muc#roominfo_description'><value>Plaudern auf und über die Website.</value></field><field label='Number of occupants' var='muc#roominfo_occupants'><value>2</value></field></x></query></iq><message xmlns='jabber:client' from='plaudern@conference.oxi.ch' to='28827123041340466382681495@public.oxi.ch/Candy' type='groupchat'><body>This room is not anonymous</body><x xmlns='http://jabber.org/protocol/muc#user'><status code='100'/></x></message><presence xmlns='jabber:client' from='plaudern@conference.oxi.ch/oXi' to='28827123041340466382681495@public.oxi.ch/Candy' xml:lang='de' id='gajim_muc_862_759281'><x xmlns='vcard-temp:x:update'><photo>4dab06a3238bb8b22bfe95d17b54b30c53d45ae3</photo></x><c xmlns='http://jabber.org/protocol/caps' node='http://gajim.org' ver='47EPEmSc9oqPGwcrbNtpKcYyJcE=' hash='sha-1'/><x xmlns='http://jabber.org/protocol/muc#user'><item jid='oxi@oxi.ch/Turak' affiliation='owner' role='moderator'/></x></presence><presence xmlns='jabber:client' from='plaudern@conference.oxi.ch/Gabi' to='28827123041340466382681495@public.oxi.ch/Candy' id='5'><x xmlns='http://jabber.org/protocol/muc#user'><item jid='gabi@braingoo.de/GabiBase' affiliation='admin' role='moderator'/></x></presence><presence xmlns='jabber:client' from='plaudern@conference.oxi.ch/admin' to='28827123041340466382681495@public.oxi.ch/Candy'><x xmlns='http://jabber.org/protocol/muc#user'><item jid='28827123041340466382681495@public.oxi.ch/Candy' affiliation='none' role='participant'/><status code='110'/><status code='100'/></x></presence><iq xmlns='jabber:client' from='braingoo@conference.oxi.ch' to='28827123041340466382681495@public.oxi.ch/Candy' id='disco3' type='result'><query xmlns='http://jabber.org/protocol/disco#info'><identity category='conference' type='text' name='Braingoo'/><feature var='http://jabber.org/protocol/muc'/><feature var='muc_hidden'/><feature var='muc_persistent'/><feature var='muc_open'/><feature var='muc_nonanonymous'/><feature var='muc_moderated'/><feature var='muc_unsecured'/><x xmlns='jabber:x:data' type='result'><field type='hidden' var='FORM_TYPE'><value>http://jabber.org/protocol/muc#roominfo</value></field><field label='Room description' var='muc#roominfo_description'><value>Plaudern auf und über braingoo.de</value></field><field label='Number of occupants' var='muc#roominfo_occupants'><value>0</value></field></x></query></iq><message xmlns='jabber:client' from='braingoo@conference.oxi.ch' to='28827123041340466382681495@public.oxi.ch/Candy' type='groupchat'><body>This room is not anonymous</body><x xmlns='http://jabber.org/protocol/muc#user'><status code='100'/></x></message><presence xmlns='jabber:client' from='braingoo@conference.oxi.ch/admin' to='28827123041340466382681495@public.oxi.ch/Candy'><x xmlns='http://jabber.org/protocol/muc#user'><item jid='28827123041340466382681495@public.oxi.ch/Candy' affiliation='none' role='participant'/><status code='110'/><status code='100'/></x></presence><message xmlns='jabber:client' from='braingoo@conference.oxi.ch' to='28827123041340466382681495@public.oxi.ch/Candy' type='groupchat'><subject>Rule #2: Double Tap!</subject><body>Gabi has set the subject to: Rule #2: Double Tap!</body></message><iq xmlns='jabber:client' from='mmojunkies@conference.oxi.ch' to='28827123041340466382681495@public.oxi.ch/Candy' type='error' id='disco3'><query xmlns='http://jabber.org/protocol/disco#info'/><error code='404' type='cancel'><item-not-found xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/><text xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'>Conference room does not exist</text></error></iq><message xmlns='jabber:client' from='plaudern@conference.oxi.ch/admin' to='28827123041340466382681495@public.oxi.ch/Candy' type='groupchat' id='8295'><body xmlns='jabber:client'>asd</body><x xmlns='jabber:x:event'><composing/></x><delay xmlns='urn:xmpp:delay' from='930112981340465804339550@public.oxi.ch/Candy' stamp='2012-06-23T15:36:49Z'/><x xmlns='jabber:x:delay' stamp='20120623T15:36:49'/></message><message xmlns='jabber:client' from='plaudern@conference.oxi.ch' to='28827123041340466382681495@public.oxi.ch/Candy' type='groupchat'><subject>test</subject><body>Gabi has set the subject to: test</body></message><presence xmlns='jabber:client' from='mmojunkies@conference.oxi.ch/admin' to='28827123041340466382681495@public.oxi.ch/Candy'><x xmlns='http://jabber.org/protocol/muc#user'><item jid='28827123041340466382681495@public.oxi.ch/Candy' affiliation='owner' role='moderator'/><status code='110'/><status code='201'/></x></presence></body>
[Jabber] Presence
[Jabber] PrivacyListError
[Jabber:Room] Disco
[Jabber] Message
[Jabber:Room] Message
[Jabber] Presence
[Jabber:Room] Presence
Unsafe JavaScript attempt to access frame with URL http://mmojunkies.net/blog/livestream/luthiuz-twitch/ from frame with URL http://chat.oxi.ch/?server=braingoo&css=darkness&name=admin. Domains, protocols and ports must match.
 jquery.min.js:4
[Jabber] Presence
[Jabber:Room] Presence
[Jabber] Presence
[Jabber:Room] Presence
[Jabber:Room] Disco
[Jabber] Message
[Jabber:Room] Message
[Jabber] Presence
[Jabber:Room] Presence
[Jabber:Room] Disco
[Jabber] Presence
[Jabber:Room] Presence
SENT: <body rid='925595' xmlns='http://jabber.org/protocol/httpbind' sid='7dbd87333d55ef3f73306290ff28a3d637132618'><iq type='set' from='28827123041340466382681495@public.oxi.ch/Candy' id='set1' xmlns='jabber:client'><query xmlns='jabber:iq:privacy'><list name='ignore'><item action='allow' order='0'/></list></query></iq><iq type='set' from='28827123041340466382681495@public.oxi.ch/Candy' id='set2' xmlns='jabber:client'><query xmlns='jabber:iq:privacy'><active name='ignore'/></query></iq></body>
RECV: <body xmlns='http://jabber.org/protocol/httpbind'><iq xmlns='jabber:client' from='plaudern@conference.oxi.ch/oXi' to='28827123041340466382681495@public.oxi.ch/Candy' id='913' xml:lang='de' type='get'><query xmlns='http://jabber.org/protocol/disco#info'/></iq><iq xmlns='jabber:client' from='28827123041340466382681495@public.oxi.ch' to='28827123041340466382681495@public.oxi.ch/Candy' id='push4033228891' type='set'><query xmlns='jabber:iq:privacy'><list name='ignore'/></query></iq><iq xmlns='jabber:client' from='28827123041340466382681495@public.oxi.ch' to='28827123041340466382681495@public.oxi.ch/Candy' id='set1' type='result'/><iq xmlns='jabber:client' from='28827123041340466382681495@public.oxi.ch' to='28827123041340466382681495@public.oxi.ch/Candy' id='set2' type='result'/></body>
[Jabber:Room] Disco
SENT: <body rid='925596' xmlns='http://jabber.org/protocol/httpbind' sid='7dbd87333d55ef3f73306290ff28a3d637132618'/>

-- snip --

mod_privacy is loaded. the unsafe errors are because of the horrible iframe i use. shame on me, but it has nothing to do with the candy problem.

thanks for any help :)

greetings, oxivanisher

mweibel commented 12 years ago

Hi, can you please specify it a little bit better? (Maybe a screenshot or something like that?)

From the log itself I don't really see anything related.

mweibel commented 12 years ago

Ok debugged this on @oxivanisher's website. The following happens (as you see from the log):

  1. User A sends presence to Room B
  2. Server replies with a message telling A that the room is not anonymous <--!
  3. Server replies with the correct presence information

As soon as 2. happens, Candy tries to display the message but as it does only render the containers for the room after 3. happened, it fails with an error and afterwards no messages are being displayed anymore.

@pstadler idea for a fix? I don't think this is very trivial but not that hard either.

pstadler commented 12 years ago

We should either open the tab when this event happens or simply drop the message. I would go for the latter, but I'm not sure how important this message actually is.

pstadler commented 12 years ago

fix of previous commit: faa57c3

pstadler commented 12 years ago

@oxivanisher this is now in the dev branch, please check if fixed and reopen if not.