My JS code is sending out requests and monitors "xhr.onreadystatechange". Sometimes it will collect the following logs, which are expected:
timestamp event method readyState status
1/9/2018 9:08:43.474 xhr_readystatechange POST 1 0
1/9/2018 9:08:46.432 xhr_readystatechange POST 2 200
1/9/2018 9:08:46.432 xhr_readystatechange POST 3 200
1/9/2018 9:08:46.433 xhr_readystatechange POST 4 200
Other times it will collect the following logs, which are not expected: (in this case, readyState never changed to 2 within the 22 seconds before my app timed out)
timestamp event method readyState status
1/11/2018 21:36:25.390 xhr_readystatechange POST 1 0
1/11/2018 21:36:47.249 localSend failed
I understand that:
- readyState 1 means xhr.open is called but xhr.send has not been called
- readyState 2 means xhr.send has been called and response header is received
My question is: if readyState changed to 1 but never changed to 2/3/4, was my POST request actually:
- never sent on the wire (xhr.send has not been called)? If so, what might have caused this? Could the request be dropped by xhr.send inside the browser JS engine?
- or, sent to the server but got stuck there for whatever reason (so response header is not ready).
Note this is on IE 11.
Thanks,