metajack / strophejs

The Strophe.js repository has moved to https://github.com/strophe/strophejs

Home Page:http://strophe.im/strophejs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

getResponse handles errors inconsistently

jfn12587 opened this issue · comments

Strophe.Request.getResponse attempts to detect if the data received is "valid", and in one invalid case will throw a "parsererror". However, if it detects responseText, it logs the same error but does not throw. This causes the function to return null, making _dataRecv effectively a no-op and polling the server again. The issue this is causing for us is that when a user loses their login credentials (cookie), the web server in front of our XMPP server returns a 302 immediately which the ajax request sees as a 200. Strophe then begins hammering the web server for binds because it thinks the connection is still active and responses are just coming back very quickly. I believe in the case of responseText on the XHR we should similarly throw a "parsererror" but I don't know if there are cases where this would not be desirable.