@@ -19,10 +19,8 @@ interface DownloadResult {
1919const CONTENT_READY_MAX_ATTEMPTS = 6 ;
2020const CONTENT_READY_BASE_DELAY_MS = 500 ;
2121const 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
2624const LINE_CONTENT_BASE_URL = "https://api-data.line.me/v2/bot/message" ;
2725
2826class RetryableLineMediaFetchError extends MediaFetchError {
@@ -37,16 +35,14 @@ function contentBackoffDelayMs(attempt: number): number {
3735}
3836
3937function 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
4542function 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.
5046async function * autoRetryStreamErrors (
5147 source : Readable ,
5248 messageId : string ,
0 commit comments