{"action":"closed","issue":{"url":"https://api.github.com/repos/jcbrand/converse.js/issues/930","repository_url":"https://api.github.com/repos/jcbrand/converse.js","labels_url":"https://api.github.com/repos/jcbrand/converse.js/issues/930/labels{/name}","comments_url":"https://api.github.com/repos/jcbrand/converse.js/issues/930/comments","events_url":"https://api.github.com/repos/jcbrand/converse.js/issues/930/events","html_url":"https://github.com/jcbrand/converse.js/issues/930","id":263698977,"number":930,"title":"MUC room rejoining issues (possibly websocket related)","user":{"login":"ftc2","id":9761890,"avatar_url":"https://avatars0.githubusercontent.com/u/9761890?v=4","gravatar_id":"","url":"https://api.github.com/users/ftc2","html_url":"https://github.com/ftc2","followers_url":"https://api.github.com/users/ftc2/followers","following_url":"https://api.github.com/users/ftc2/following{/other_user}","gists_url":"https://api.github.com/users/ftc2/gists{/gist_id}","starred_url":"https://api.github.com/users/ftc2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ftc2/subscriptions","organizations_url":"https://api.github.com/users/ftc2/orgs","repos_url":"https://api.github.com/users/ftc2/repos","events_url":"https://api.github.com/users/ftc2/events{/privacy}","received_events_url":"https://api.github.com/users/ftc2/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-10-08T07:17:05Z","updated_at":"2017-10-31T21:22:53Z","closed_at":"2017-10-31T21:22:53Z","author_association":"NONE","body":"here's my config:\r\n\r\n```\r\n<link type=\"text/css\" rel=\"stylesheet\" media=\"screen\" href=\"https://cdn.conversejs.org/3.2.1/css/converse.min.css\" />\r\n<script src=\"https://cdn.conversejs.org/3.2.1/dist/converse.min.js\"></script>\r\n\r\n...\r\n\r\n    converse.initialize({\r\n        websocket_url: 'wss://example.org:5280/xmpp-ws',\r\n        auto_login: true,\r\n        authentication: 'login',\r\n        jid: 'testguy@example.org',\r\n        password: 'testpass',\r\n        auto_join_rooms: ['main@chat.example.org'],\r\n        show_controlbox_by_default: false,\r\n        allow_registration: false,\r\n        muc_nickname_from_jid: true,\r\n        allow_muc_invitations: false,\r\n        hide_muc_server: true,\r\n        show_send_button: true,\r\n        allow_bookmarks: false,\r\n        show_desktop_notifications: false,\r\n        debug: true,\r\n    });\r\n```\r\nit works great until you refresh the page (or navigate to another page that has converse.js embedded).\r\n\r\nwhen this happens, it seems like it's not properly rejoining the room (but it does reconnect to the websocket).\r\n\r\nwhen you try to message the room, you get errors like \"Only occupants are allowed to send messages to the conference\"\r\n\r\nalso, the 'occupants' list is often empty, and other users don't see you rejoin.\r\n\r\nclearing the session storage (`sessionStorage.clear()`) every time before initializing converse.js fixes it because it doesn't know to try to restore stuff.\r\n\r\nhere's a debug log from when you refresh the page: https://gist.github.com/ftc2/3171bc1354dbb9dee8eeaa5f67c8a386\r\n\r\n```\r\nconverse.min.js:253 INFO: Could not restore session for jid: testguy@example.org Error message: The \"restore\" method can only be used with a BOSH connection.\r\nconverse.min.js:253 INFO: Status changed to: CONNECTING\r\nconverse.min.js:253 INFO: Websocket open\r\nconverse.min.js:253 DEBUG: <open xmlns=\"urn:ietf:params:xml:ns:xmpp-framing\" to=\"example.org\" version=\"1.0\"/>\r\nconverse.min.js:253 DEBUG: <open xmlns=\"urn:ietf:params:xml:ns:xmpp-framing\" version=\"1.0\" xml:lang=\"en\" id=\"16927444315671971344\" from=\"example.org\"/>\r\nconverse.min.js:253 INFO: _connect_cb was called\r\nconverse.min.js:253 DEBUG: <stream:features xmlns:stream=\"http://etherx.jabber.org/streams\"><mechanisms xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\"><mechanism>PLAIN</mechanism><mechanism>X-OAUTH2</mechanism></mechanisms></stream:features>\r\nconverse.min.js:253 DEBUG: <auth xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\" mechanism=\"PLAIN\">dGVzdGd1eUBkZXYudGVhZm9ydW0ub3JnAHRlc3RndXkAcGxzX2hhdmVfbWVyY3lfYW5kX2RvbnRfYWJ1c2U=</auth>\r\nconverse.min.js:253 INFO: _dataRecv called\r\nconverse.min.js:253 DEBUG: <success xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\"/>\r\nconverse.min.js:253 INFO: SASL authentication succeeded.\r\nconverse.min.js:253 DEBUG: <open xmlns=\"urn:ietf:params:xml:ns:xmpp-framing\" to=\"example.org\" version=\"1.0\"/>\r\nconverse.min.js:253 INFO: _dataRecv called\r\nconverse.min.js:253 DEBUG: <open xmlns=\"urn:ietf:params:xml:ns:xmpp-framing\" version=\"1.0\" xml:lang=\"en\" id=\"11051170068692438812\" from=\"example.org\"/>\r\nconverse.min.js:253 INFO: _dataRecv called\r\nconverse.min.js:253 DEBUG: <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\"><optional/></session><sm xmlns=\"urn:xmpp:sm:2\"/><sm xmlns=\"urn:xmpp:sm:3\"/></stream:features>\r\nconverse.min.js:253 DEBUG: <iq type=\"set\" id=\"_bind_auth_2\" xmlns=\"jabber:client\"><bind xmlns=\"urn:ietf:params:xml:ns:xmpp-bind\"><resource>converse.js-73083438</resource></bind></iq>\r\nconverse.min.js:253 INFO: _dataRecv called\r\nconverse.min.js:253 DEBUG: <iq xmlns=\"jabber:client\" id=\"_bind_auth_2\" type=\"result\"><bind xmlns=\"urn:ietf:params:xml:ns:xmpp-bind\"><jid>testguy@example.org/converse.js-73083438</jid></bind></iq>\r\nconverse.min.js:253 DEBUG: <iq type=\"set\" id=\"_session_auth_2\" xmlns=\"jabber:client\"><session xmlns=\"urn:ietf:params:xml:ns:xmpp-session\"/></iq>\r\nconverse.min.js:253 INFO: _dataRecv called\r\nconverse.min.js:253 DEBUG: <iq xmlns=\"jabber:client\" type=\"result\" id=\"_session_auth_2\"/>\r\nconverse.min.js:253 INFO: Status changed to: CONNECTED\r\nconverse.min.js:253 INFO: Connected\r\nconverse.min.js:253 DEBUG: <iq from=\"testguy@example.org/converse.js-73083438\" id=\"enablecarbons\" type=\"set\" xmlns=\"jabber:client\"><enable xmlns=\"urn:xmpp:carbons:2\"/></iq>\r\nconverse.min.js:253 DEBUG: <iq type=\"get\" xmlns=\"jabber:client\" id=\"00eb9867-831f-40bb-bc9d-efc1a983407c:sendIQ\"><vCard xmlns=\"vcard-temp\"/></iq>\r\nconverse.min.js:253 DEBUG: <iq from=\"testguy@example.org/converse.js-73083438\" to=\"example.org\" type=\"get\" xmlns=\"jabber:client\" id=\"a4cfb1e1-615a-45f3-ab19-19cc4334fa69:sendIQ\"><query xmlns=\"http://jabber.org/protocol/disco#info\"/></iq>\r\nconverse.min.js:253 DEBUG: <iq type=\"get\" id=\"864fc7ee-054e-422f-8302-6d3a750e0bd6:roster\" xmlns=\"jabber:client\"><query xmlns=\"jabber:iq:roster\"/></iq>\r\nconverse.min.js:233 [Violation] 'message' handler took 2240ms\r\nconverse.min.js:253 INFO: _dataRecv called\r\nconverse.min.js:253 DEBUG: <iq xmlns=\"jabber:client\" from=\"testguy@example.org\" to=\"testguy@example.org/converse.js-73083438\" type=\"error\" id=\"enablecarbons\"><enable xmlns=\"urn:xmpp:carbons:2\"/><error code=\"503\" type=\"cancel\"><service-unavailable xmlns=\"urn:ietf:params:xml:ns:xmpp-stanzas\"/><text xmlns=\"urn:ietf:params:xml:ns:xmpp-stanzas\">No module is handling this query</text></error></iq>\r\nconverse.min.js:253 ERROR: An error occured while trying to enable message carbons.\r\np.log @ converse.min.js:253\r\n(anonymous) @ converse.min.js:253\r\nrun @ converse.min.js:251\r\n(anonymous) @ converse.min.js:251\r\nforEachChild @ converse.min.js:250\r\n_dataRecv @ converse.min.js:251\r\n_onMessage @ converse.min.js:252\r\nconverse.min.js:253 INFO: _dataRecv called\r\nconverse.min.js:253 DEBUG: <iq xmlns=\"jabber:client\" from=\"testguy@example.org\" to=\"testguy@example.org/converse.js-73083438\" type=\"error\" id=\"00eb9867-831f-40bb-bc9d-efc1a983407c:sendIQ\"><vCard xmlns=\"vcard-temp\"/><error code=\"503\" type=\"cancel\"><service-unavailable xmlns=\"urn:ietf:params:xml:ns:xmpp-stanzas\"/><text xmlns=\"urn:ietf:params:xml:ns:xmpp-stanzas\">No module is handling this query</text></error></iq>\r\nconverse.min.js:253 INFO: _dataRecv called\r\nconverse.min.js:253 DEBUG: <iq xmlns=\"jabber:client\" from=\"example.org\" to=\"testguy@example.org/converse.js-73083438\" type=\"error\" id=\"a4cfb1e1-615a-45f3-ab19-19cc4334fa69:sendIQ\"><query xmlns=\"http://jabber.org/protocol/disco#info\"/><error code=\"501\" type=\"cancel\"><feature-not-implemented xmlns=\"urn:ietf:params:xml:ns:xmpp-stanzas\"/><text xmlns=\"urn:ietf:params:xml:ns:xmpp-stanzas\">No module is handling this query</text></error></iq>\r\n[Violation] Forced reflow while executing JavaScript took 32ms\r\nconverse.min.js:253 INFO: _dataRecv called\r\nconverse.min.js:253 DEBUG: <iq xmlns=\"jabber:client\" from=\"testguy@example.org\" to=\"testguy@example.org/converse.js-73083438\" type=\"error\" id=\"864fc7ee-054e-422f-8302-6d3a750e0bd6:roster\"><query xmlns=\"jabber:iq:roster\"/><error code=\"503\" type=\"cancel\"><service-unavailable xmlns=\"urn:ietf:params:xml:ns:xmpp-stanzas\"/><text xmlns=\"urn:ietf:params:xml:ns:xmpp-stanzas\">No module is handling this query</text></error></iq>\r\nconverse.min.js:253 DEBUG: <message to=\"main@chat.example.org\" type=\"groupchat\" xmlns=\"jabber:client\"><composing xmlns=\"http://jabber.org/protocol/chatstates\"/><no-store xmlns=\"urn:xmpp:hints\"/><no-permanent-store xmlns=\"urn:xmpp:hints\"/></message>\r\nconverse.min.js:253 INFO: _dataRecv called\r\nconverse.min.js:253 DEBUG: <message xmlns=\"jabber:client\" from=\"main@chat.example.org\" to=\"testguy@example.org/converse.js-73083438\" type=\"error\"><composing xmlns=\"http://jabber.org/protocol/chatstates\"/><no-store xmlns=\"urn:xmpp:hints\"/><no-permanent-store xmlns=\"urn:xmpp:hints\"/><error code=\"406\" type=\"modify\"><not-acceptable xmlns=\"urn:ietf:params:xml:ns:xmpp-stanzas\"/><text xmlns=\"urn:ietf:params:xml:ns:xmpp-stanzas\">Only occupants are allowed to send messages to the conference</text></error></message>\r\nconverse.min.js:253 DEBUG: <message to=\"main@chat.example.org\" from=\"testguy@example.org/converse.js-73083438\" type=\"groupchat\" id=\"0df59028-d2a1-4cb8-86ac-f100d0c96916\" xmlns=\"jabber:client\"><body>can't send this!</body><x xmlns=\"jabber:x:event\"><composing/></x></message>\r\nconverse.min.js:253 DEBUG: <message to=\"main@chat.example.org\" type=\"groupchat\" xmlns=\"jabber:client\"><active xmlns=\"http://jabber.org/protocol/chatstates\"/><no-store xmlns=\"urn:xmpp:hints\"/><no-permanent-store xmlns=\"urn:xmpp:hints\"/></message>\r\nconverse.min.js:253 INFO: _dataRecv called\r\nconverse.min.js:253 DEBUG: <message xmlns=\"jabber:client\" from=\"main@chat.example.org\" to=\"testguy@example.org/converse.js-73083438\" type=\"error\" id=\"0df59028-d2a1-4cb8-86ac-f100d0c96916\"><body>can't send this!</body><x xmlns=\"jabber:x:event\"><composing/></x><error code=\"406\" type=\"modify\"><not-acceptable xmlns=\"urn:ietf:params:xml:ns:xmpp-stanzas\"/><text xmlns=\"urn:ietf:params:xml:ns:xmpp-stanzas\">Only occupants are allowed to send messages to the conference</text></error></message>\r\nconverse.min.js:253 INFO: _dataRecv called\r\nconverse.min.js:253 DEBUG: <message xmlns=\"jabber:client\" from=\"main@chat.example.org\" to=\"testguy@example.org/converse.js-73083438\" type=\"error\"><active xmlns=\"http://jabber.org/protocol/chatstates\"/><no-store xmlns=\"urn:xmpp:hints\"/><no-permanent-store xmlns=\"urn:xmpp:hints\"/><error code=\"406\" type=\"modify\"><not-acceptable xmlns=\"urn:ietf:params:xml:ns:xmpp-stanzas\"/><text xmlns=\"urn:ietf:params:xml:ns:xmpp-stanzas\">Only occupants are allowed to send messages to the conference</text></error></message>\r\n```\r\n\r\ni first posted on stackexchange: https://stackoverflow.com/questions/46627589/muc-room-presence-issues-when-restoring-session\r\nmy ejabberd config is there if that's helpful"}}
{"actor":{"display_login":"jcbrand"}}