Repository navigation
fix(telegram): disable HTTP/2 for all Telegram polling dispatchers - #69243
Magicray1217 wants to merge 1 commit into
Conversation
Undici 8 enables HTTP/2 ALPN by default, but Telegram's long-polling connections stall on Windows due to IPv6 + H2 multiplexing issues. The core fetch-guard already sets allowH2:false for guarded paths, but the Telegram extension creates its own Agent/ProxyAgent/EnvHttpProxyAgent instances directly from undici without this flag. Apply allowH2:false to all dispatcher constructors in the Telegram transport layer, matching the approach used in src/infra/net/undici-runtime.ts. Fixes openclaw#66885
Greptile SummaryApplies Confidence Score: 5/5Safe to merge; all dispatcher paths correctly receive allowH2: false and the only finding is a trivial dead-code ternary. All four dispatcher construction paths are consistently patched and the change matches the established pattern in the core fetch-guard. The sole finding is a P2 style issue (an always-true typeof guard) that has no runtime impact. No files require special attention. Prompt To Fix All With AIThis is a comment left during a code review.
Path: extensions/telegram/src/fetch.ts
Line: 281
Comment:
**Redundant ternary on always-string field**
`policy.proxyUrl` is typed as `string` in the `explicit-proxy` variant of `PinnedDispatcherPolicy` (see `src/infra/net/ssrf.ts`), so the `typeof … === "string"` check is always `true` and the `policy.proxyUrl!` else-branch is dead code. The whole expression simplifies to `policy.proxyUrl`.
```suggestion
uri: policy.proxyUrl,
```
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "fix(telegram): disable HTTP/2 for all Te..." | Re-trigger Greptile |
| } satisfies ConstructorParameters<typeof ProxyAgent>[0]) | ||
| : policy.proxyUrl; | ||
| : ({ | ||
| uri: typeof policy.proxyUrl === "string" ? policy.proxyUrl : policy.proxyUrl!, |
There was a problem hiding this comment.
Redundant ternary on always-string field
policy.proxyUrl is typed as string in the explicit-proxy variant of PinnedDispatcherPolicy (see src/infra/net/ssrf.ts), so the typeof … === "string" check is always true and the policy.proxyUrl! else-branch is dead code. The whole expression simplifies to policy.proxyUrl.
| uri: typeof policy.proxyUrl === "string" ? policy.proxyUrl : policy.proxyUrl!, | |
| uri: policy.proxyUrl, |
Prompt To Fix With AI
This is a comment left during a code review.
Path: extensions/telegram/src/fetch.ts
Line: 281
Comment:
**Redundant ternary on always-string field**
`policy.proxyUrl` is typed as `string` in the `explicit-proxy` variant of `PinnedDispatcherPolicy` (see `src/infra/net/ssrf.ts`), so the `typeof … === "string"` check is always `true` and the `policy.proxyUrl!` else-branch is dead code. The whole expression simplifies to `policy.proxyUrl`.
```suggestion
uri: policy.proxyUrl,
```
How can I resolve this? If you propose a fix, please make it concise.|
Maintainer triage: correct root cause for #66885, but I would not merge this standalone yet. Code shape looks right: every Telegram dispatcher path in Blockers before merge:
Suggested fix: rebase on #68128 or fold this into #68128 by adding |
Summary
Undici 8 enables HTTP/2 ALPN by default, causing Telegram long-polling connections to stall on Windows (IPv6 + H2 multiplexing issues).
The core fetch-guard (\src/infra/net/undici-runtime.ts) already applies \�llowH2: false\ for guarded paths, but the Telegram extension creates its own \Agent/\ProxyAgent/\EnvHttpProxyAgent\ instances directly from undici without this flag.
Changes
Affected files
Fixes #66885