Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for onProgress event when using Chunked Transfer Encoding fixes #17823 #71

Closed
wants to merge 1 commit into from

Conversation

Projects
None yet
2 participants
@lsolano
Copy link
Contributor

commented Mar 27, 2014

Background

To fire a progress event named e means to fire an event named e with an event using the ProgressEvent interface that also meets these conditions:

  • Initialize the loaded attribute to the number of HTTP entity body bytes transferred
  • If the length of the HTTP entity body is known through the Content-Length header, initialize the lengthComputable attribute to true and initialize the total attribute to the length.

The problem

When dealing with chunked transfer encoding and dojo/request the underlying xhr object properly reports the progress using the onProgress event, with readyState of 3, but the dojo wrapper (dojo/request/xhr); only considers a progress event when the lengthComputable property of the event is true.

By definition a chunked response can not report the total length of the response because generally is build on the fly. Also the Content-Length header must not be sent for chunked responses. So there is no way to compute the length.

In summary, using dojo/request we can not be informed about the progress of a chunked response due to the missing info about the total length. Treating a very large response, that was transferred as chunked , like a normal one. Without the possibility to get the individual chunks the caller is forced to wait until the final bits.

Proposal ( #17823 )

Modify the dojo/request/xhr wrapper to consider a progress event when the Transfer-Encoding header value is chunked and the readyState is 3 (LOADING).

@dylans

This comment has been minimized.

Copy link
Member

commented Mar 28, 2014

Hi @lsolano, thanks for the pull request. Per our contributing guidelines, can you verify if you have a CLA on file and have you opened a ticket in the Dojo bug tracker? https://github.com/dojo/dojo/blob/master/CONTRIBUTING.md has more details if this doesn't make sense.

Once that is done, we'll take a look at this and consider your proposed change. Thanks again for your interest in Dojo, and your proposed contribution!

@lsolano lsolano changed the title Add support for onProgress event when using Chunked Transfer Encoding Add support for onProgress event when using Chunked Transfer Encoding fixes #17823 Mar 28, 2014

@lsolano

This comment has been minimized.

Copy link
Contributor Author

commented Mar 28, 2014

Hi @dylans thank for your time,

I have signed the CLA (user: lsolano, email: lorenzo.sm@gmail.com). Also I logged into https://bugs.dojotoolkit.org and try to find a matching issue / enhancement that covers the changes proposed; but I can't find any. Finally, I've created the enhancement request #17823 (https://bugs.dojotoolkit.org/ticket/17823#).

Regards,

@dylans dylans modified the milestones: 1.11, 1.10 Apr 9, 2014

@dylans

This comment has been minimized.

Copy link
Member

commented May 9, 2014

Closed via e4dea97, thanks for the contribution.

@dylans dylans closed this May 9, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.