Skip to content

refactor: replace fromStart with since in log redirection - #908

Merged
barjin merged 25 commits into
masterfrom
claude/exciting-einstein-3vuyel
Dec 2, 2026
Merged

barjin merged 25 commits into
masterfrom
claude/exciting-einstein-3vuyel

Conversation

@Pijukatel

@Pijukatel Pijukatel commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

apify-client 3.0.0-beta.127 replaces the fromStart option of RunClient.getStreamedLog() with since, so this pins it, updates the log redirection guide, and redirects the run log in Actor.callTask() like in Actor.call().

barjin and others added 3 commits December 1, 2026 14:33
`apify-client` v3 drops the `fromStart` option of
`RunClient.getStreamedLog()` in favor of `since`
(apify/apify-client-js#1263). `Actor.call()` with a `runName` now passes
`since: new Date()` for a resumed run, which redirects only the new log
lines as `fromStart: false` did, and no `since` for a new run.

The log redirection guide uses `since` as well.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017ocuAHmLPYNoNM4jGrzrJ2
@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

⚠️ There are broken links in the documentation.

See more at https://github.com/apify/apify-sdk-js/actions/runs/46880584691#summary-143458241485

barjin and others added 9 commits December 1, 2026 15:14
It is the first published client version with the `since` option of
`RunClient.getStreamedLog()`. The version is pinned exactly: a `^` range
would resolve to `3.0.0-rc.2`, which sorts higher and still has
`fromStart`.

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

`Actor.call()` with a `runName` records the timestamp of the last log
line it redirected in the tracked child run, as `logRedirectedAt`. It is
saved on each `persistState` event, which also precedes a migration and
a reboot, and when the redirect stops.

A later call under the same name passes that timestamp plus one
millisecond as `since`, so the redirect continues right after the last
recorded line. Before, a resumed run was redirected from the moment of
the call, which lost the lines logged while this run was migrating. A
resumed run with no recorded line has its whole log redirected.

The tracker now writes through the key-value store it loaded from, since
an event listener runs outside the scope of the Actor's methods.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017ocuAHmLPYNoNM4jGrzrJ2
@Pijukatel Pijukatel changed the title refactor: replace fromStart with since in log redirection feat: continue the log redirect of a named child run after the last redirected line Dec 1, 2026
claude and others added 5 commits December 1, 2026 16:56
`Actor.callTask()` with a `runName` redirects the log of the task run
the way `Actor.call()` does, and tracks it the same way: the last
redirected line is recorded in the tracked child run and a later call
under the same name continues after it. Before, a named task call did
not redirect the log, and passing `log` with `runName` threw, because
the option was forwarded to the start of the task.

Both named calls now share one wait:

- If the log redirect cannot be set up, the call logs a warning and
  waits for the run without its log. The run is already started then.
- Concurrent calls that share one run redirect its log once.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017ocuAHmLPYNoNM4jGrzrJ2
`#waitForChildRun()` had a try/catch for the setup of the log redirect
nested in the try/finally that stops it. The setup moves to
`#startChildRunLogRedirect()`, which leaves one try/finally.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017ocuAHmLPYNoNM4jGrzrJ2
@Pijukatel
Pijukatel requested a review from barjin December 2, 2026 07:53
@Pijukatel
Pijukatel marked this pull request as ready for review December 2, 2026 07:56
@Pijukatel
Pijukatel requested a review from szaganek as a code owner December 2, 2026 07:56
…alid

The tracker options were validated after `initialized` was set, so `init()` could not be retried after the error.
@Pijukatel
Pijukatel marked this pull request as draft December 2, 2026 09:18
@Pijukatel

Copy link
Copy Markdown
Contributor Author

Will be done after release. Only version of this minimal part needs to go before release: fa02bd5

@barjin
barjin changed the base branch from master to refactor/remove-child-run-tracking December 2, 2026 10:42
@barjin barjin changed the title feat: continue the log redirect of a named child run after the last redirected line refactor: replace fromStart with since in log redirection Dec 2, 2026
@barjin
barjin added this pull request to stack #929 December 2, 2026 10:48
Base automatically changed from refactor/remove-child-run-tracking to master December 2, 2026 12:04
@barjin
barjin marked this pull request as ready for review December 2, 2026 12:26
@barjin
barjin merged commit b443b4c into master Dec 2, 2026
9 checks passed
@barjin
barjin deleted the claude/exciting-einstein-3vuyel branch December 2, 2026 12:26
B4nan added a commit that referenced this pull request Dec 3, 2026
Final pass over the v4 upgrading guide against released 3.8.0. Every
breaking change on `master` was already covered; this adds what was
missing:

- `Actor.callTask()` now redirects the task run's log like
`Actor.call()` (#908). In 3.x it went through the v2 client's
`TaskClient.call()`, which didn't.
- The intro links the Crawlee and `apify-client` upgrading guides, and
all links point at the released docs instead of `/next/`. They resolve
once crawlee 4.0.0 and apify-client 3.0.0 are out, so merge this after
those two releases.
- `KeyValueStore.getPublicUrl()` gets its own heading; it was sitting
under the request queue access modes.
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.

3 participants