network.request - technically when does params.timeout fire?

in this case Timeout is a value:

  • to use for name resolution. If resolution takes longer than this time-out value, the action is canceled. 

  • to use for server connection requests. If a connection request takes longer than this time-out value, the request is canceled. 

  • to use for sending requests. If sending a request takes longer than this time-out value, the send is canceled. 

  • to receive a response to a request. If a response takes longer than this time-out value, the request is canceled. 

I’m sure about the last two points: As I said in my op, I set the timeout to one second and send a large image as b64 string to my server in one single request. The upload took a couple of seconds and it DID go through. So, the request took longer than the time-out value and it was clearly NOT canceled. Or am I Missing something?

http 1.1 data is divided into chunks, so your large image is sending as set of many chunks and timeout applies to 1 chunk

Cool, I did not know this. Thank you very much for clarification, vitaly. Appreciate the support here :slight_smile:

One additional question: Does the event.isError get fired when timeout applies?

yes, event.isError will be ‘true’ if timeout expired,

here output from Windows 

event=

{

  “bytesEstimated”:0,

  “bytesTransferred”:0,

  “isError”:true,

  “name”:“networkRequest”,

  “phase”:“ended”,

  “requestId”:"<userdata>",

  “response”:“Timed out”,

  “responseType”:“text”,

  “status”:-1,

}

Very helpful answer, thank you sir :slight_smile: