Skip to content

Commit e9063f3

Browse files
committed
fix(telegram): only suppress EADDRNOTAVAIL in forceFallback, preserve timeout/network fallback
ClawSweeper P1: the original forceFallback used the full shouldUseTelegramTransportFallback classifier, which rejected probe timeout/network errors (no 'fetch failed' + codes) that still need IPv4 fallback promotion. Fix: collect codes from the error and only check isLocalSocketAllocationError(codes) — EADDRNOTAVAIL. All other errors continue to promoteStickyAttempt as before.
1 parent 908d183 commit e9063f3

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

extensions/telegram/src/fetch.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -883,10 +883,14 @@ export function resolveTelegramTransport(
883883
sourceFetch,
884884
dispatcherAttempts: transportAttempts.map((attempt) => attempt.exportAttempt),
885885
forceFallback: (reason: string, err?: unknown) => {
886-
if (err !== undefined && !shouldUseTelegramTransportFallback(err)) {
887-
return false;
886+
if (err !== undefined) {
887+
const codes = collectErrorCodes(err);
888+
if (isLocalSocketAllocationError(codes)) {
889+
return false;
890+
}
888891
}
889-
return promoteStickyAttempt(stickyAttemptIndex + 1, new Error("forced fallback"), reason);
892+
promoteStickyAttempt(stickyAttemptIndex + 1, new Error("forced fallback"), reason);
893+
return true;
890894
},
891895
close,
892896
};

0 commit comments

Comments
 (0)