Skip to content

feat!: replace fromStart with since in streamed logs and reopen closed streams - #1263

Merged
Pijukatel merged 4 commits into
masterfrom
claude/exciting-einstein-3vuyel
Dec 1, 2026
Merged

Pijukatel merged 4 commits into
masterfrom
claude/exciting-einstein-3vuyel

Conversation

@Pijukatel

@Pijukatel Pijukatel commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor
  • getStreamedLog() and StreamedLog take since?: Date. fromStart is removed, since v3 is a breaking release; the upgrading guide covers it. getStreamedLog() now validates its options, so a leftover fromStart throws an ArgumentValidationError.
  • New StreamedLog.lastRedirectedAt: pass it plus 1 ms as since to continue the redirection after a restart.
  • A log stream that is cut off on a quiet but still running run is reopened, and lines up to lastRedirectedAt are skipped. The reopen re-downloads the whole log, because the API can't start from a given point.

Stacked on #1237, so the base is its branch.

Closes #1262
Python counterpart: apify/apify-client-python#1253

@github-actions github-actions Bot added the t-tooling Issues with this label are in the ownership of the tooling team. label Dec 1, 2026
@github-actions

github-actions Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

✅ The link checker did not find any broken links.

See more at https://github.com/apify/apify-client-js/actions/runs/46659750412#summary-142685765321

@Pijukatel
Pijukatel added this pull request to stack #1264 December 1, 2026 13:34
@Pijukatel Pijukatel changed the title feat: add since to streamed logs and reopen closed streams feat!: replace fromStart with since in streamed logs and reopen closed streams Dec 1, 2026
@Pijukatel
Pijukatel marked this pull request as ready for review December 1, 2026 14:56
@Pijukatel
Pijukatel requested a review from szaganek as a code owner December 1, 2026 14:56
@Pijukatel
Pijukatel requested a review from barjin December 1, 2026 14:56
Base automatically changed from claude/intelligent-cerf-xz42y2 to master December 1, 2026 15:26
- `getStreamedLog()` and `StreamedLog` take `since?: Date`. `fromStart`
  is deprecated and will be removed in v4.
- New `StreamedLog.lastRedirectedAt`: pass it plus 1 ms as `since` to
  continue the redirection after a restart.
- A log stream that is cut off on a quiet but still running run fails
  with a transport error. It is reopened, and lines up to
  `lastRedirectedAt` are skipped. The reopen re-downloads the whole log,
  because the API can't start from a given point.

A timeout while reading the stream counts as a cut-off stream too, since
the HTTP libraries end a response that carries no data for a while with
one: `fetch` of Node.js after 5 minutes, axios after `timeoutSecs`.
`AxiosHttpClient.isRetryableTransportError()` now recognizes the plain
`ECONNRESET` error a streamed response fails with in Node.js.

A message whose first chunk has no end of line is no longer redirected
cut in two.

Port of apify/apify-client-python#1253.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017ocuAHmLPYNoNM4jGrzrJ2
`RunClient.getStreamedLog()` and `StreamedLog` no longer take
`fromStart`. v3 is a breaking release, so the option is removed instead
of deprecated, and `since` is the only way to redirect part of a log.

`getStreamedLog()` now validates its options with a strict schema, so a
leftover `fromStart` throws an `ArgumentValidationError` instead of
silently redirecting the whole log.

The v3 upgrading guide describes the change and the reopening of a log
stream that is cut off.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017ocuAHmLPYNoNM4jGrzrJ2
@Pijukatel
Pijukatel force-pushed the claude/exciting-einstein-3vuyel branch from 61a9ab9 to 1a990fd Compare December 1, 2026 15:26

@barjin barjin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Few docs nits (and one lint / code quality one), but nothing blocking.

Thanks @Pijukatel !

Comment thread docs/02_concepts/05_logging.mdx Resolved
Comment thread src/resource_clients/log.ts Resolved
Comment thread src/resource_clients/log.ts Resolved
Comment thread src/resource_clients/log.ts Resolved
Pijukatel and others added 2 commits December 1, 2026 17:02
Co-authored-by: Jindřich Bär <jindrichbar@gmail.com>
…ction docs

The loop that opens log streams now runs while redirection is not
stopped, and the one-shot read of the log follows it instead of sitting
at the top of an endless loop.

The docs and the JSDoc of `lastRedirectedAt` no longer describe why a
log stream is interrupted or how the client replays it.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017ocuAHmLPYNoNM4jGrzrJ2
@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

⚠️ There are broken links in the documentation.

See more at https://github.com/apify/apify-client-js/actions/runs/46689251881#summary-142791764037

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

Add since and stream reopening to StreamedLog

3 participants