@@ -6,16 +6,17 @@ import { readAppName } from "./teleboxInfoHelper";
66import { logger } from "./logger" ;
77import { initializeClientSession } from "./loginManager" ;
88
9- // ── Fix teleproto main-DC media upload deadlock ────────────────────────────
10- // teleproto (through 1.228.0) still routes upload.SaveFilePart through a
11- // separate media sender even when the target is the account's main DC. On
12- // affected sessions that media sender's auth is rejected and every part waits
13- // through all scheduler deadlines, while the exact same SaveFilePart succeeds
14- // immediately through the already-authorized main sender.
9+ // ── Fix teleproto main-DC media upload deadlock (upstream #24 still open) ──
10+ // teleproto through 1.228.1 still routes upload.SaveFilePart via MediaScheduler's
11+ // media sender even when dcId === session.dcId. On affected sessions that path
12+ // burns requestRetries × deadline while client.invoke(SaveFilePart) succeeds.
13+ //
14+ // 1.228.1 fixed #25 (download AbortSignal/requestTimeout) and #28 (keepalive
15+ // interval option) — no TeleBox patches needed for those. #24 remains open, so
16+ // keep this main-DC short-circuit. channelGapBreaker stays for #26 (still open).
1517//
1618// Route only main-DC uploads through client.invoke(). Non-main DC operations
1719// retain the native MediaScheduler path (including migration/retry logic).
18- // This is a TeleBox runtime hook; the npm dependency remains untouched.
1920// ───────────────────────────────────────────────────────────────────────────
2021( function patchMainDcMediaUpload ( ) {
2122 try {
@@ -110,8 +111,8 @@ async function createClient(): Promise<TelegramClient> {
110111 console . log ( "使用代理连接 Telegram:" , proxy ) ;
111112 }
112113
113- // teleproto ≥1.228.0 enables TCP keepalive + setNoDelay natively in
114- // PromisedNetSockets (hardcoded 30s ). No CustomPromisedNetSockets needed.
114+ // teleproto ≥1.228.0 enables TCP keepalive + setNoDelay natively;
115+ // 1.228.1 adds keepAliveInterval option (#28 ). No CustomPromisedNetSockets needed.
115116 // Keep proxy.timeout default so SOCKS connect doesn't hang forever.
116117 if ( proxy && ! proxy . timeout ) {
117118 proxy . timeout = 10 ; // seconds
0 commit comments