Bugfix. Flush connection just after connection.

Solves a weird problem I've encountered with PubSub and Prosody, whereby a
returned HTTP response is not received by the browser. Underlying cause is
still unknown, but is BOSH related and it appears to be that the HTTP request
being responded to by Prosody is no longer open/valid.
This commit is contained in:
JC Brand 2016-05-11 09:10:27 +00:00
parent c243aba98f
commit af89109670

View File

@ -637,6 +637,18 @@
// know whether these boxes are of the same account or not, so we
// close them now.
var deferred = new $.Deferred();
// XXX: ran into an issue where a returned PubSub BOSH response was
// not received by the browser. The solution was to flush the
// connection early on. I don't know what the underlying cause of
// this issue is, and whether it's a Strophe.js or Prosody bug.
// My suspicion is that Prosody replies to an invalid/expired
// Request, which is why the browser then doesn't receive it.
// In any case, flushing here (sending out a new BOSH request)
// solves the problem.
converse.connection.flush();
/* Called as soon as a new connection has been established, either
* by logging in or by attaching to an existing BOSH session.
*/
this.chatboxviews.closeAllChatBoxes();
this.jid = this.connection.jid;
this.bare_jid = Strophe.getBareJidFromJid(this.connection.jid);