Skip to content

fix: Unify the request pipeline across HTTP clients - #1011

Draft
vdusek wants to merge 3 commits into
masterfrom
move-http-pipeline-to-base
Draft

fix: Unify the request pipeline across HTTP clients#1011
vdusek wants to merge 3 commits into
masterfrom
move-http-pipeline-to-base

Conversation

@vdusek

@vdusek vdusek commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Moves call, the retry loop, and the per-attempt request handling from ImpitHttpClient and ImpitHttpClientAsync into HttpClient and HttpClientAsync, leaving Impit as a thin adapter over the transport hooks: send_request, is_retryable_transport_error, is_timeout_error, and close() / aclose() plus context managers. A custom client that overrides call keeps working unchanged and opts out of the shared pipeline. StreamedLog classifies timeouts through the transport-neutral is_timeout_error hook instead of importing Impit.

No behavior change for the built-in clients: retry classification stays exactly as on master (every impit.HTTPError is transient). The classification fixes follow in #1012.

Split out of #1006. Stacked on #1010.

✍️ Drafted by Claude Code

@vdusek vdusek added adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team. labels Aug 17, 2026
@vdusek vdusek self-assigned this Aug 17, 2026
@codecov

codecov Bot commented Aug 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.60479% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.93%. Comparing base (df8a08d) to head (e6f24c5).

Files with missing lines Patch % Lines
src/apify_client/_streamed_log.py 75.00% 2 Missing ⚠️
src/apify_client/http_clients/_base.py 98.41% 2 Missing ⚠️
Additional details and impacted files
@@                      Coverage Diff                       @@
##           fix-http-response-protocol    #1011      +/-   ##
==============================================================
+ Coverage                       94.87%   94.93%   +0.05%     
==============================================================
  Files                              58       58              
  Lines                            5367     5388      +21     
==============================================================
+ Hits                             5092     5115      +23     
+ Misses                            275      273       -2     
Flag Coverage Δ
integration 92.03% <77.84%> (-0.20%) ⬇️
unit 85.22% <97.00%> (+0.07%) ⬆️

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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Base automatically changed from fix-http-response-protocol to master August 17, 2026 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants