mirror of
https://github.com/wassname/pi-telegram.git
synced 2026-06-27 13:45:33 +08:00
b866807112
Wrap fetch calls in callTelegram, callTelegramMultipart, and downloadTelegramFile with bounded retry (max 3 attempts, 500ms/2000ms backoff with jitter) on transient network codes and a per-attempt 15s AbortController timeout so a stuck connection can't wedge the bridge indefinitely. HTTP 4xx/5xx still surface as before. Add a process-level unhandledRejection handler so a stray rejection from a fire-and-forget void f() (e.g. timer-driven preview flush) can't crash the host under Node 22's default unhandledRejection=throw - which is how a remote session got dropped. Also tighten the two timer-callback voids that can fire after their turn's try/catch is gone.