MSTeams: add upload session fallback for large files#32558
MSTeams: add upload session fallback for large files#32558zwright8 wants to merge 1 commit intoopenclaw:mainfrom
Conversation
Greptile SummaryThis PR adds a resumable Graph upload-session fallback to Key observations:
Confidence Score: 4/5
Last reviewed commit: 5b6eee3 |
|
|
||
| if (nextChunkStart === chunkStart) { | ||
| stalledResponses += 1; | ||
| if (stalledResponses > UPLOAD_SESSION_MAX_STALLS) { |
There was a problem hiding this comment.
Off-by-one: allows 6 stalls, not 5
UPLOAD_SESSION_MAX_STALLS is set to 5, but the guard uses strict greater-than (>), so stalledResponses must reach 6 before the error is thrown. This means the session is actually retried 6 times, not 5. The test confirms this (it provides 6 stalled responses before expecting the throw).
The constant's name and value imply the limit is 5, but the implementation allows one extra retry. Use >= to match the constant's intent:
| if (stalledResponses > UPLOAD_SESSION_MAX_STALLS) { | |
| if (stalledResponses >= UPLOAD_SESSION_MAX_STALLS) { |
Prompt To Fix With AI
This is a comment left during a code review.
Path: extensions/msteams/src/graph-upload.ts
Line: 125
Comment:
**Off-by-one: allows 6 stalls, not 5**
`UPLOAD_SESSION_MAX_STALLS` is set to `5`, but the guard uses strict greater-than (`>`), so `stalledResponses` must reach **6** before the error is thrown. This means the session is actually retried 6 times, not 5. The test confirms this (it provides 6 stalled responses before expecting the throw).
The constant's name and value imply the limit is 5, but the implementation allows one extra retry. Use `>=` to match the constant's intent:
```suggestion
if (stalledResponses >= UPLOAD_SESSION_MAX_STALLS) {
```
How can I resolve this? If you propose a fix, please make it concise.5b6eee3 to
45bd05e
Compare
|
Hi @zwright8 — 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 @zwright8 — 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 |
|
Codex review: found issues before merge. What this changes: The branch adds a Teams Graph upload-session fallback for OneDrive and SharePoint uploads over 4 MB, plus tests for simple uploads, chunked uploads, retry/stall behavior, session creation errors, and SharePoint. Maintainer follow-up before merge: This is an open implementation PR with a valid missing feature, maintainer assignment, and stale-branch integration issues; the next action is Teams maintainer rebase/review, not an autonomous cleanup close or standalone replacement job. Security review: Security review cleared: The diff adds Microsoft Graph upload-session calls and tests without new dependencies, workflow changes, package metadata changes, secret storage changes, or broader token scopes. Review findings:
Review detailsBest possible solution: Land a rebased Teams-only implementation that keeps direct Do we have a high-confidence way to reproduce the issue? Yes. Current main can be inspected at the helper level: both upload helpers always issue a single Is this the best way to solve the issue? No, not as-is. The upload-session fallback belongs in the Teams upload helper, but this branch needs a rebase onto current main, must preserve the existing User-Agent and Full review comments:
Overall correctness: patch is incorrect Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 9061d1e4c3ee. |
|
This assigned pull request has been marked as stale after being open for 27 days. |
|
This assigned pull request has been automatically marked as stale after being open for 27 days. |
|
This assigned pull request has been automatically marked as stale after being open for 27 days. |
|
This assigned pull request has been automatically marked as stale after being open for 27 days. |
|
This assigned pull request has been automatically marked as stale after being open for 27 days. |
|
Closing due to inactivity. |
Summary
Validation
pnpm exec vitest run extensions/msteams/src/graph-upload.test.tsContext
This PR is one focused slice extracted from the previously oversized PR: