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 |
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: