Skip to content

Commit 31a330c

Browse files
committed
fix(msteams): let valueResponses override hostedContents mock
- In mockGraphMediaFetch, check valueResponses before the default hostedContents path so oversized collection tests actually exercise the bounded read overflow path - Existing tests unchanged — backward compatible mock behavior 🦞 diamond lobster: P2 fix — collection overflow test now hits real path Ref. #98833
1 parent d195573 commit 31a330c

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

bash.exe.stackdump

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Stack trace:
2+
Frame Function Args
3+
000FFFF9F78 0018006021E (00180252DED, 001802340A6, 000FFFF9F78, 000FFFF8E70)
4+
000FFFF9F78 00180048859 (00000000000, 00000000000, 00000000000, 00000000000)
5+
000FFFF9F78 00180048892 (00180252EA9, 000FFFF9E28, 000FFFF9F78, 00000000000)
6+
000FFFF9F78 001800AF0D8 (00000000000, 00000000000, 00000000000, 00000000000)
7+
000FFFF9F78 001800AF25D (000FFFF9F90, 00000000000, 00000000000, 00000000000)
8+
000FFFFA200 001800B0673 (000FFFF9F90, 00000000000, 00000000000, 00000000000)
9+
End of stack trace

extensions/msteams/src/attachments/graph.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,11 @@ function mockGraphMediaFetch(options: {
120120
);
121121
}
122122
if (url.endsWith("/hostedContents")) {
123+
for (const [fragment, response] of Object.entries(options.valueResponses ?? {})) {
124+
if (url.includes(fragment)) {
125+
return guardedFetchResult(params, response);
126+
}
127+
}
123128
return guardedFetchResult(params, mockFetchResponse({ value: options.hostedContents ?? [] }));
124129
}
125130
for (const [fragment, response] of Object.entries(options.valueResponses ?? {})) {

0 commit comments

Comments
 (0)