LargeFileUploadTask.upload throws PassThrough.
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 30/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- node.js, typescript
- Domain
- api
Research direction
Start with LargeFileUploadTask.upload, the FileUpload construction, and createUploadSession call shown in the report; reproduce the intermittent failure with Node 20 and the 30 one-megabyte OneDrive uploads. Done means identifying why PassThrough is surfaced and documenting or fixing prevention or handling, with the behavior verified against the supplied scenario.
Written by the indexing model from the issue text.
Description
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
- Dominant language
- TypeScript
- Stars
- 833
- Forks
- 240
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoftgraph/msgraph-sdk-javascript
-
status:waiting-for-triage
Difficulty 1/5 Under an hour Newbie friendliness 62/100
-
Is anyone here? Open
Difficulty 4/5 3-5 days Newbie friendliness 25/100
microsoftgraph/msgraph-sdk-javascript#2005 · 1 reaction ·
-
Is it really correct that the Javascript version of the graph SDK doesn't offer typed requests? Openstatus:waiting-for-triage
Difficulty 5/5 Over a week Newbie friendliness 42/100
-
status:waiting-for-triage type:bug
Difficulty 3/5 1-2 days Newbie friendliness 48/100
microsoftgraph/msgraph-sdk-javascript#1999 · 2 comments · 1 reaction ·
-
status:waiting-for-triage type:bug
Difficulty 4/5 3-5 days Newbie friendliness 45/100
All issues in microsoftgraph/msgraph-sdk-javascript
Similar issues
-
Type/Bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
OpenNSW/nsw-srilanka#497 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
0xMiden/bridge-portal#132 ·
-
react-doctor severity:warning tech-debt
Difficulty 1/5 Under an hour Newbie friendliness 88/100
digidem/comapeo-cloud-app#403 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100