Skip to content

http: fix compatibility with fasthttp RoundTripper - #253

Merged
liuzengh merged 2 commits into
trpc-group:mainfrom
liuzengh:codex/fix-fasthttp-roundtripper
Oct 10, 2026
Merged

liuzengh merged 2 commits into
trpc-group:mainfrom
liuzengh:codex/fix-fasthttp-roundtripper

Conversation

@liuzengh

Copy link
Copy Markdown
Contributor

Combining trpc-go v1.1.0 with mongodb v1.0.0 selects fasthttp v1.51.0 and fails to compile because NewFastHTTPClient assigns a function to HostClient.Transport, which became a RoundTripper interface in fasthttp v1.49.0.

Assign FastHTTPCli directly using its existing RoundTrip implementation, and upgrade fasthttp to v1.52.0 with the required transitive dependencies and checksums.

Validation:

  • go test -mod=readonly ./... -count=1 -timeout=5m passed on Go 1.19.13 and Go 1.24.11.
  • go build -mod=readonly ./... passed on Go 1.18.10 and Go 1.24.11.
  • golangci-lint run --new-from-rev=origin/main --timeout=5m passed.
  • A separate consumer importing trpc-go/http and mongodb v1.0.0 built successfully with this branch supplied through a local module replacement.

Fixes #249

RELEASE NOTES: Fix compilation failures when using tRPC-Go with dependencies that select newer fasthttp versions, including mongodb v1.0.0.

@liuzengh liuzengh added the type/bug Fixes a newly discovered bug label Oct 10, 2026
@codecov

codecov Bot commented Oct 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.25984%. Comparing base (56cbf53) to head (842c8bd).

Additional details and impacted files
@@                 Coverage Diff                 @@
##                main        #253         +/-   ##
===================================================
- Coverage   85.48709%   85.25984%   -0.22725%     
===================================================
  Files            215         215                 
  Lines          19052       19050          -2     
===================================================
- Hits           16287       16242         -45     
- Misses          2094        2127         +33     
- Partials         671         681         +10     
Flag Coverage Δ
unittests 85.25984% <100.00000%> (-0.22725%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@liuzengh
liuzengh requested a review from bytethm October 10, 2026 03:05

@bytethm bytethm left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@liuzengh
liuzengh merged commit 4dfbb18 into trpc-group:main Oct 10, 2026
6 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 10, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

type/bug Fixes a newly discovered bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

trpc-go v1.1.0 不兼容 fasthttp v1.51+,建议同步升级生态库依赖

2 participants