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

LargeFileUploadTask.upload throws PassThrough. #1895

Open
hayashiyasufumi opened this issue Mar 5, 2025 · 0 comments
Open

LargeFileUploadTask.upload throws PassThrough. #1895

hayashiyasufumi opened this issue Mar 5, 2025 · 0 comments
Labels
status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience

Comments

@hayashiyasufumi
Copy link

Describe the bug

When uploading 30 1MB files to OneDrive, LargeFileUploadTask.upload occasionally (about once in 5 times) throws PassThrough.

Expected behavior

I want to know how to prevent PassThrough from being thrown. Or, I want to know how to handle PassThrough when it is caught.

How to reproduce

The src is as follows:

const uploadSession = await LargeFileUploadTask.createUploadSession(
  graphClient,
  uploadSessionUrl,
  {
    item: {
      '@microsoft.graph.conflictBehavior': 'rename',
      name: filename,
    },
  },
);

const fileUpload = new FileUpload(
  fileContent,
  filename,
  fileContent.length,
);

const uploadTask = new LargeFileUploadTask(graphClient, fileUpload, uploadSession, {
  rangeSize: 1048576,
});

try {
  const uploadResult = await uploadTask.upload();

  return uploadResult?.responseBody
    ? (uploadResult.responseBody as DriveItem)
    : null;
} catch (e) {
  this.logger.error({
    message: e.constructor?.name+' '+JSON.stringify(e),
  });
  throw e;
}

SDK Version

3.0.7

Latest version known to work for scenario above?

No response

Known Workarounds

No response

Debug output

Click to expand log ``` PassThrough { "_events": {}, "_readableState": { "highWaterMark": 16384, "buffer": [ { "type": "Buffer", "data": [・・・] } ], "bufferIndex": 0, "length": 8062, "pipes": [], "awaitDrainWriters": null }, "_writableState": { "highWaterMark": 16384, "length": 0, "corked": 0, "writelen": 0, "bufferedIndex": 0, "pendingcb": 0 }, "allowHalfOpen": true, "_eventsCount": 2 } ```

Configuration

  • node:20-alpine3.19
  • node.version v20.18.0

Other information

No response

@hayashiyasufumi hayashiyasufumi added status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience labels Mar 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience
Projects
None yet
Development

No branches or pull requests

1 participant