Skip to content

v3 does not support pausing/resuming from stream #346

Closed

Description

@drzraf

The current pause process consist into aborting all ongoing XHR object. Conversely resume call Flow.upload() again which goes over each pending chunk.

In the case of ReadableStream we can not expect to read() twice a regular file (as expected by FlowChunk.send()).
A possible implementation could conserve the XHR payload in order to recreate it again (instead of setting FlowChunk's XHR to null)

Activity

  1. changed the title [-]v3 does not support resuming from stream[/-] [+]v3 does not support pausing/resuming from stream[/+] on Aug 5, 2021
  2. drzraf commented on Aug 12, 2021

    @drzraf
    CollaboratorAuthor

    I've a problem with the current code paths.

    If I call await files[0].chunks[0].send(); (uploading only one chunk of one file), it'll call FlowChunk.doneHandler() which in turn calls parent's flowObj.uploadNextChunk() which read/consume/send all remaining chunks.
    It's a counter-intuitive design. Wouldn't we prefer a more predictable chaining process?

  3. AidasK commented on Aug 12, 2021

    @AidasK
    Member

    I think you have mentioned this problem earlier. I agree that it can be improved

  4. drzraf commented on Aug 12, 2021

    @drzraf
    CollaboratorAuthor

    I also wonder about the following:
    An xhr.error(); => doneHandler (status === 'error') => abort(true)
    Why not using the retry() logic? Eg: We may receive a 400 or Timeout error because of some bandwidth exhaustion and it's worth retrying don't you think?

  5. drzraf commented on Sep 16, 2021

    @drzraf
    CollaboratorAuthor

    #348 fixed it. Pause & resuming from stream now works.
    The counter-intuitive pause()/resume() design can be solved in a subsequent issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions