Skip to content

Large File Upload - retry doesn't work for StreamUpload #452

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

Closed
mdybich opened this issue May 12, 2021 · 2 comments · Fixed by #460
Closed

Large File Upload - retry doesn't work for StreamUpload #452

mdybich opened this issue May 12, 2021 · 2 comments · Fixed by #460
Assignees
Labels
Milestone

Comments

@mdybich
Copy link

mdybich commented May 12, 2021

Bug Report

Description

It looks like the retry for the large file upload doesn't work for StreamUpload.
When the resume is invoked, in the first step the getStatus method is called in order to update expiry and nextRange properties - at this step everything is fine.

After properties are properly updated, the upload is called and then sliceFile() from the StreamUpload that is causing a problem - it should read the bytes that should be retried, but instead, it's just getting next portion of bytes which seems to be not correct since the bytes that should be retired are not read from the stream.

Steps to Reproduce

Call resume method when the StreamUpload is passed to the LargeFileUploadTask:

function test(): Promise<any> {
   const fileObject = new StreamUpload(readStream, data.fileName, data.fileSize);
   const uploadTask = new LargeFileUploadTask(client, fileObject, uploadSession);

  try {
    await uploadTask.upload();
  } catch(error) {
    await uploadTask.resume();
  }
}

Expected behavior: The upload is properly resumed for the stream data.

Actual behavior: The retry doesn't work for the stream data.

Usage Information

SDK Version - 3.0.0-Preview.1

AB#9415

@ghost ghost added the ToTriage label May 12, 2021
@nikithauc nikithauc self-assigned this May 12, 2021
@nikithauc
Copy link
Contributor

@mdybich Thank you for reporting this issue! I will take a look at it.

@nikithauc nikithauc added this to the 3.0.0 milestone May 12, 2021
@nikithauc
Copy link
Contributor

@mdybich A fix for this has been released in https://www.npmjs.com/package/@microsoft/microsoft-graph-client/v/3.0.0-Preview.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants