When getting an unexpected response, since version 3.9, Orbeon Forms' client-side code is looking at the content of the response to see if it recognized it as an error produced by Orbeon Forms' server-side code. In that case, it doesn't retry, estimating that the error was likely to happen again. Otherwise, it tries again to send the request to the server. But is always retrying when we can an unexpected response which isn't Orbeon error the wisest choice? Let's see what those pages could be:
- A user starts filling out a form at home, then walks downstairs to a coffee shop, orders her latte, and connects to the Wi-Fi to finish filling out the form, at which point she gets a page with a checkbox asking her to accept usage guideline for the Wi-Fi, which she does. If Orbeon Forms issues an Ajax request before she accepts the conditions, it will get that same page. Obviously, in this situation we'd like Orbeon Forms to retry the request.
- A user starts filling out a form, closes his laptop, drives home, and opens his laptop to continue his work. Unfortunately, in the meantime his session expired, and Ajax requests are served a login page. Obviously, in this situation retrying won't help, and we would be better off notifying the user that he needs to login again.