fix(matrix): use JSON-specific idle-timeout diagnostic on bounded JSO… · openclaw/openclaw@4e99ec6
Alix-007
·
2026-06-24
·
via Recent Commits to openclaw:main
File tree
extensions/matrix/src/matrix/sdk
| Original file line number | Diff line number | Diff line change |
|---|
@@ -261,7 +261,7 @@ describe("performMatrixRequest", () => {
|
261 | 261 | ); |
262 | 262 | }); |
263 | 263 | |
264 | | -it("uses the configured idle-timeout error for stalled JSON downloads", async () => { |
| 264 | +it("uses the JSON-specific idle-timeout error for stalled JSON downloads", async () => { |
265 | 265 | vi.useFakeTimers(); |
266 | 266 | try { |
267 | 267 | const stream = new ReadableStream<Uint8Array>({ |
@@ -291,7 +291,7 @@ describe("performMatrixRequest", () => {
|
291 | 291 | }); |
292 | 292 | |
293 | 293 | const rejection = expect(requestPromise).rejects.toThrow( |
294 | | -"Matrix media download stalled: no data received for 50ms", |
| 294 | +"Matrix JSON response stalled: no data received for 50ms", |
295 | 295 | ); |
296 | 296 | await vi.advanceTimersByTimeAsync(60); |
297 | 297 | await rejection; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -364,6 +364,8 @@ export async function performMatrixRequest(params: {
|
364 | 364 | `Matrix JSON response exceeds configured size limit (${size} bytes > ${maxBytes} bytes)`, |
365 | 365 | ), |
366 | 366 | chunkTimeoutMs: params.readIdleTimeoutMs, |
| 367 | +onIdleTimeout: ({ chunkTimeoutMs }) => |
| 368 | +new Error(`Matrix JSON response stalled: no data received for ${chunkTimeoutMs}ms`), |
367 | 369 | }); |
368 | 370 | return { |
369 | 371 | response, |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。