feat(msteams): support resumable upload sessions for files > 4MB#21739
feat(msteams): support resumable upload sessions for files > 4MB#21739krishna-warfade wants to merge 12 commits intoopenclaw:mainfrom
Conversation
| } | ||
|
|
||
| lastResponseData = await res.json(); | ||
| start = Math.max(start, end); |
There was a problem hiding this comment.
Math.max(start, end) is unnecessary since end is always >= start
| start = Math.max(start, end); | |
| start = end; |
Prompt To Fix With AI
This is a comment left during a code review.
Path: extensions/msteams/src/graph-upload.ts
Line: 60
Comment:
`Math.max(start, end)` is unnecessary since `end` is always >= `start`
```suggestion
start = end;
```
How can I resolve this? If you propose a fix, please make it concise.|
This pull request has been automatically marked as stale due to inactivity. |
|
Hi @krishna-warfade — thanks for the submission. I’m the new Microsoft Teams maintainer for OpenClaw. Please give me a day or two to work through the open Teams backlog. Also, join the Twitter community for daily MS Teams feedback + updates: https://x.com/i/communities/2031170403607974228 |
1 similar comment
|
Hi @krishna-warfade — thanks for the submission. I’m the new Microsoft Teams maintainer for OpenClaw. Please give me a day or two to work through the open Teams backlog. Also, join the Twitter community for daily MS Teams feedback + updates: https://x.com/i/communities/2031170403607974228 |
Summary
PUT /contentGraph API endpoint, which has a hard 4MB file size limit./createUploadSession) and uploads in ~3.1MB chunks (a required multiple of 320 KiB). Both uploadToOneDrive and uploadToSharePoint now auto-detect files > 4MB and use this path.Change Type
Scope
Linked Issue/PR
TODOcomment:For files >4MB, implement resumable upload session.User-visible / Behavior Changes
Previously, sending a file > 4MB via the MS Teams bot would fail at the upload step. After this change, files of any size upload successfully. No config changes required.
Security Impact (required)
NoNoYes— addsPOST .../createUploadSession+ chunkedPUTrequests to a temporary Microsoft-issued upload URL.NoNouploadUrlis pre-authenticated and short-lived (Microsoft-issued). No bearer token is sent in chunkPUTrequests — follows Microsoft's recommended pattern exactly.Repro + Verification
Steps
Expected
File uploads and a sharing link is returned successfully regardless of file size.
Actual
File uploads and a sharing link is returned successfully.
Evidence
PUT /contentcallPOST /createUploadSession+ multiplePUTs with correctContent-RangeheadersHuman Verification (required)
Content-Rangeheaders per Microsoft Graph spec.Compatibility / Migration
YesNoNoFailure Recovery
400 Bad RequestoncreateUploadSession.Risks and Mitigations
Greptile Summary
Added support for resumable upload sessions for files > 4MB in MS Teams integration, resolving a hard limitation that caused silent upload failures. The implementation adds a new
uploadChunked()helper that creates a Microsoft Graph upload session and uploads files in ~3.1MB chunks (a required multiple of 320 KiB). BothuploadToOneDriveanduploadToSharePointnow auto-detect files > 4MB and use the chunked upload path, while files ≤ 4MB continue using the simple upload endpoint.Major changes:
uploadChunked()function for handling resumable upload sessions with proper Content-Range headersuploadToOneDriveto use upload sessions for files > 4MB (lines 91-123)uploadToSharePointto use upload sessions for files > 4MB (lines 269-301)The change is backward compatible and requires no configuration changes. All existing callers work without modification.
Confidence Score: 4/5
Math.max()usage, but this does not affect correctness.Last reviewed commit: 2247f3f
(2/5) Greptile learns from your feedback when you react with thumbs up/down!