jakartaee / faces

Jakarta Faces
Other
109 stars 55 forks source link

Ajax Test missing on the error case behavior in the request chain #1800

Open werpu opened 1 year ago

werpu commented 1 year ago

Hi, I noticed following, the spec is rather vague on how to treat the error chain in the ajax error case.

The spec states in the jsdocs:

Regardless of the outcome of the request (success or error) every request in the queue must be handled. Examine the status of each request in the queue starting from the request that has been in the queue the longest. If the status of the request is complete (readyState 4), dequeue the request (remove it from the queue). If the request has not been sent (readyState 0), send the request. Requests that are taken off the queue and sent should not be put back on the queue.

I am not aware of a test testing this behavior! (I might have missed one)

A test would look like this:

  1. Offer a series of xhr request
  2. One of the tests in the middle causes an error on the server (exception suffices in an action or action listener)!
  3. The result must be that all 5 requests must have been processed one way or the other and onerror must have been called!
werpu commented 1 year ago

I have the test working, but it needs a proper name. Question, how should I name the test? I probably cannot name it Issue1800IT because it refers to a github issue! Once the name issue is cleared i can offer a pull request! (very likely monday) To test exactly this behavior!