Skip to content

feat: port apify-client-js content encoding, log bytes and dataset stream to the Rust client - #30

Merged
Pijukatel merged 8 commits into
masterfrom
claude/youthful-franklin-u46frr
Oct 20, 2026
Merged

Pijukatel merged 8 commits into
masterfrom
claude/youthful-franklin-u46frr

Conversation

@Pijukatel

@Pijukatel Pijukatel commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Ports the Rust-relevant features from the reference apify-client-js batch (apify/apify-client-js#1140, #1141, #1152, #1139, #1145). No OpenAPI spec change: the client stays on v2-2026-10-08T073338Z, which matches the live spec.

  • KeyValueStoreClient::set_record_raw_with_content_encoding uploads a value that is already compressed, and the client skips its own compression (apify-client-js#1140).
  • LogClient::get_bytes / get_bytes_with_options return the raw log bytes (apify-client-js#1141).
  • DatasetClient::download_items_stream streams a dataset export with constant memory use (apify-client-js#1152, which supersedes #1139).
  • Streaming requests (log().stream() and download_items_stream()) now go through the configured HttpBackend via a new default method, HttpBackend::send_streaming, which doesn't break existing backends. Before this, they used an unconfigured reqwest::Client. They also get a response-start timeout and a per-chunk inactivity timeout, so a stalled stream ends instead of hanging.
  • Stale "0.6" install-version pins in README.md and docs/ are corrected.

…ient

Ports apify-client-js #1140 (setRecord contentEncoding), #1141 (log.get
buffer), and #1152 (downloadItems stream, superseding #1139's
streamItems). No OpenAPI spec change. Factors the raw-streaming-GET
logic LogClient::stream already had into a shared base::get_byte_stream
helper, now reused by DatasetClient::download_items_stream.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3FfQf9r45KVCa5VAYAjkd
Addresses review iteration 1: trims the ApifyClientError and
get_byte_stream rustdoc to drop cross-client narration/caller-list
padding, and wraps get_byte_stream's send() in a
DEFAULT_REQUEST_TIMEOUT response-start timeout so a dead connection
surfaces ApifyClientError::Timeout instead of hanging forever.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3FfQf9r45KVCa5VAYAjkd
Adds HttpBackend::send_streaming (default: buffer via send(), so
existing backends keep compiling) and HttpClient::call_streaming,
which applies auth/user-agent like call() and bounds the
response-start wait plus per-chunk inactivity without capping total
stream duration. base::get_byte_stream now delegates to it instead of
opening its own unconfigured reqwest::Client, so log().stream() and
download_items_stream() honor a custom or proxy/TLS-configured
backend like every buffered endpoint.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3FfQf9r45KVCa5VAYAjkd
call_streaming now uses the caller-supplied request.timeout (the
per-endpoint base every buffered call also uses) instead of the
client-wide retry budget, so the field base.rs populates is no longer
silently ignored; the reuse as both response-start and per-chunk
inactivity window is documented as matching the reference clients'
single-timeoutSecs streaming semantics. with_inactivity_timeout now
ends the stream after one Err(Timeout) instead of retrying the
stalled read forever.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3FfQf9r45KVCa5VAYAjkd
LogClient::stream_with_options and DatasetClient::download_items_stream
still described streaming as going "through reqwest directly" /
"bypassing the buffered backend", which was true before commit
7749f74 routed it through the configured HttpBackend. Updated both
comments to describe the current behavior.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3FfQf9r45KVCa5VAYAjkd
Both were pub(crate) but, after this branch's earlier streaming
refactor consolidated their only call sites into http_client.rs
itself, had no callers outside the module. Dead cross-module reach;
no behavior change.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3FfQf9r45KVCa5VAYAjkd
LogClient::stream and DatasetClient::download_items_stream promised
unconditional completion/no corruption without mentioning the
6-minute per-chunk inactivity timeout call_streaming now applies,
contradicting documented behavior for a quiet-but-still-running
stream. Also softened the call_streaming budget-reuse comment, which
claimed closer mechanism-level parity with the JS reference's
axios/Node socket-level idle timeout than is accurate (same outcome,
different mechanism).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3FfQf9r45KVCa5VAYAjkd
README.md (x2) and docs/README.md pinned an install version from
long before the crate's current 0.13.0, incompatible with every
feature those same pages document (streaming, get_bytes,
set_record_raw_with_content_encoding, wait_for_resources,
HttpBackend, ...). Bumped all three to "0.13".

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3FfQf9r45KVCa5VAYAjkd
@Pijukatel Pijukatel 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 Oct 19, 2026 — with Claude
@apify-service-account apify-service-account added the tested Temporary label used only programatically for some analytics. label Oct 19, 2026
@Pijukatel
Pijukatel merged commit f1450d3 into master Oct 20, 2026
2 of 7 checks passed
@Pijukatel
Pijukatel deleted the claude/youthful-franklin-u46frr branch October 20, 2026 06:54
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. tested Temporary label used only programatically for some analytics.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants