Skip to content

Commit 20db7af

Browse files
ant1eicherclaude
andauthored
fix(feishu): remove invalid timeout properties from SDK method calls (#38267)
The `timeout` property is not part of the Lark SDK method signatures, causing TS2353 errors. The client-level `httpTimeoutMs` already applies the timeout to all requests. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 7ce79c8 commit 20db7af

2 files changed

Lines changed: 2 additions & 13 deletions

File tree

extensions/feishu/src/media.test.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -182,19 +182,15 @@ describe("sendMediaFeishu msg_type routing", () => {
182182
);
183183
});
184184

185-
it("uses image upload timeout override for image media", async () => {
185+
it("uploads image for image media", async () => {
186186
await sendMediaFeishu({
187187
cfg: {} as any,
188188
to: "user:ou_target",
189189
mediaBuffer: Buffer.from("image"),
190190
fileName: "photo.png",
191191
});
192192

193-
expect(imageCreateMock).toHaveBeenCalledWith(
194-
expect.objectContaining({
195-
timeout: 120_000,
196-
}),
197-
);
193+
expect(imageCreateMock).toHaveBeenCalled();
198194
expect(messageCreateMock).toHaveBeenCalledWith(
199195
expect.objectContaining({
200196
data: expect.objectContaining({ msg_type: "image" }),
@@ -320,7 +316,6 @@ describe("sendMediaFeishu msg_type routing", () => {
320316
expect(imageGetMock).toHaveBeenCalledWith(
321317
expect.objectContaining({
322318
path: { image_key: imageKey },
323-
timeout: 120_000,
324319
}),
325320
);
326321
expect(result.buffer).toEqual(Buffer.from("image-data"));
@@ -512,7 +507,6 @@ describe("downloadMessageResourceFeishu", () => {
512507
expect.objectContaining({
513508
path: { message_id: "om_audio_msg", file_key: "file_key_audio" },
514509
params: { type: "file" },
515-
timeout: 120_000,
516510
}),
517511
);
518512
expect(result.buffer).toBeInstanceOf(Buffer);
@@ -532,7 +526,6 @@ describe("downloadMessageResourceFeishu", () => {
532526
expect.objectContaining({
533527
path: { message_id: "om_img_msg", file_key: "img_key_1" },
534528
params: { type: "image" },
535-
timeout: 120_000,
536529
}),
537530
);
538531
expect(result.buffer).toBeInstanceOf(Buffer);

extensions/feishu/src/media.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ export async function downloadImageFeishu(params: {
106106

107107
const response = await client.im.image.get({
108108
path: { image_key: normalizedImageKey },
109-
timeout: FEISHU_MEDIA_HTTP_TIMEOUT_MS,
110109
});
111110

112111
const buffer = await readFeishuResponseBuffer({
@@ -146,7 +145,6 @@ export async function downloadMessageResourceFeishu(params: {
146145
const response = await client.im.messageResource.get({
147146
path: { message_id: messageId, file_key: normalizedFileKey },
148147
params: { type },
149-
timeout: FEISHU_MEDIA_HTTP_TIMEOUT_MS,
150148
});
151149

152150
const buffer = await readFeishuResponseBuffer({
@@ -202,7 +200,6 @@ export async function uploadImageFeishu(params: {
202200
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- SDK accepts Buffer or ReadStream
203201
image: imageData as any,
204202
},
205-
timeout: FEISHU_MEDIA_HTTP_TIMEOUT_MS,
206203
});
207204

208205
// SDK v1.30+ returns data directly without code wrapper on success
@@ -277,7 +274,6 @@ export async function uploadFileFeishu(params: {
277274
file: fileData as any,
278275
...(duration !== undefined && { duration }),
279276
},
280-
timeout: FEISHU_MEDIA_HTTP_TIMEOUT_MS,
281277
});
282278

283279
// SDK v1.30+ returns data directly without code wrapper on success

0 commit comments

Comments
 (0)