fix(telegram): retain socket failure context#96830
Conversation
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Close as superseded: #97130 is the clean current-main replacement, explicitly says it supersedes this PR while preserving contributor credit, and carries the same focused Telegram fix with proof. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Canonical path: Use #97130 as the canonical clean landing path, then close the linked issue and remaining same-root PRs after that replacement lands. So I’m closing this here and keeping the remaining discussion on #97130. Review detailsBest possible solution: Use #97130 as the canonical clean landing path, then close the linked issue and remaining same-root PRs after that replacement lands. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection shows current main still drops the original probe error before forced fallback, and the replacement PR includes Darwin and Linux real-kernel EADDRNOTAVAIL proof for the corrected behavior. Is this the best way to solve the issue? Yes, but the best landing path is the replacement PR, not this superseded branch. The replacement keeps the fix owner-local, preserves valid fallback recovery, and avoids maintaining two same-root candidate PRs. Security review: Security review cleared: No concrete security or supply-chain issue remains for this close decision; the canonical replacement diff is limited to Telegram source and tests. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against 1bccd2930437. |
|
Superseded by the clean maintainer rewrite in #97130, landed as 072d3ed. The final implementation keeps your useful error-forwarding direction, removes the broad message classifier, preserves alternate-IP recovery, and makes the warning cause-neutral. The fork branch could not accept a clean ancestry rewrite through maintainer access, so I recreated the final four-file patch; your authorship is preserved with a Thank you, @zhangguiping-xydt. |
What Problem This Solves
Fixes #94620.
When a Telegram startup probe fails and explicitly promotes the transport fallback, the transport currently discards the original error. That produces
codes=noneand can pair a local socket failure with the inaccurate claim that a DNS-resolved IP was unreachable.Why This Change Was Made
forceFallbackso the existing transport diagnostic reports its structured socket code.EADDRNOTAVAILfetch failure is not automatically retried, while a probe can still promote the alternate IPv4 or pinned-IP path.The original patch disabled probe fallback for
EADDRNOTAVAIL. Maintainer review found that too broad: Linux ephemeral-port allocation is destination-sensitive, so a different remote Telegram IP can still provide a usable socket tuple. Keeping recovery while preserving the real error is the bounded owner-local fix.User Impact
Telegram startup fallback logs now retain
EADDRNOTAVAILand avoid misleading DNS wording. Existing alternate-IP recovery remains available, including when a different destination tuple can recover from local port pressure.Evidence
node scripts/run-vitest.mjs extensions/telegram/src/fetch.test.ts extensions/telegram/src/probe.test.ts../../node_modules/.bin/oxfmt --check extensions/telegram/src/fetch.ts extensions/telegram/src/probe.ts extensions/telegram/src/fetch.test.ts extensions/telegram/src/probe.test.ts../../node_modules/.bin/oxlint --deny-warnings extensions/telegram/src/fetch.ts extensions/telegram/src/probe.ts extensions/telegram/src/fetch.test.ts extensions/telegram/src/probe.test.tsgit diff --checkEADDRNOTAVAIL(errno=-49); direct fallback was false; two explicit promotions returned true and retainedcodes=EADDRNOTAVAIL.tbx_01kw38m62y2gccvpbgy5kafgx8EADDRNOTAVAIL(errno=-99) with the same fallback decisions.aca7d9ae1c47f6521ada4c244635818b8473f95cpassedpnpm check:changedfor the extension and extension-test lanes.