Clarify the behaviour of Javascript Validation when we are waiting for the full body
There is test which expects the window.fetch to be resolved while the server is sending the response. If ORB is compatible with this behaviour, then it means ORB will allow the promise to resolve before it has made its decision about this request, otherwise this test would hang because ORB will wait for the full response indefinitely.
This contradicts to The promise should throw if it's blocked by ORB.
The current spec text for consuming the body stream for ORB is
Fully read response’s body given processBody and processBodyError
Wait for responseBodyBytes to be non-null.
Fully read response’s body given processBody and processBodyError would return a fully read body as promise and responseBodyBytes would be non-null when the full read body promise is resolved. So this is a blocking behaviour (thanks @annevk for clarifying this). However, this blocking behaviour contradicts to the test that I linked.
Should we allow the promise to be resolved first and only allow the body stream to be consumed if ORB allows this request?
Let me know if I misunderstand something.
I think you understood it correctly. I think we have to change the test. I suspect that instead of returning a response with an infinitely streaming body we'd instead hit a network timeout.
cc @jakearchibald