Skip to content

Commit 0157f34

Browse files
Pick-catcursoragent
andcommitted
fix(line): oxlint curly; keep size S
Co-authored-by: Cursor <[email protected]>
1 parent 2a31360 commit 0157f34

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

‎extensions/line/src/download.ts‎

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,8 @@ interface DownloadResult {
1919
const CONTENT_READY_MAX_ATTEMPTS = 6;
2020
const CONTENT_READY_BASE_DELAY_MS = 500;
2121
const CONTENT_READY_MAX_DELAY_MS = 4000;
22-
// Readiness polls only (202 → retry); body transfer uses a separate wall-clock.
23-
const CONTENT_READY_TIMEOUT_MS = 15_000;
24-
// After HTTP 200; aligned with Slack/Feishu inbound media totals (default 10MB).
25-
const LINE_MEDIA_BODY_TIMEOUT_MS = 120_000;
22+
const CONTENT_READY_TIMEOUT_MS = 15_000; // readiness polls only
23+
const LINE_MEDIA_BODY_TIMEOUT_MS = 120_000; // post-200 body wall-clock
2624
const LINE_CONTENT_BASE_URL = "https://api-data.line.me/v2/bot/message";
2725

2826
class RetryableLineMediaFetchError extends MediaFetchError {
@@ -37,16 +35,14 @@ function contentBackoffDelayMs(attempt: number): number {
3735
}
3836

3937
function resolvePositiveTimeoutMs(timeoutMs: number | undefined, fallbackMs: number): number {
40-
return typeof timeoutMs === "number" && Number.isFinite(timeoutMs) && timeoutMs > 0
41-
? Math.floor(timeoutMs)
42-
: fallbackMs;
38+
const ok = typeof timeoutMs === "number" && Number.isFinite(timeoutMs) && timeoutMs > 0;
39+
return ok ? Math.floor(timeoutMs) : fallbackMs;
4340
}
4441

4542
function lineContentUrl(messageId: string): string {
4643
return `${LINE_CONTENT_BASE_URL}/${encodeURIComponent(messageId)}/content`;
4744
}
4845

49-
// Stream errors are retryable; consumer errors (e.g. size limits) pass through.
5046
async function* autoRetryStreamErrors(
5147
source: Readable,
5248
messageId: string,

0 commit comments

Comments
 (0)