Repository navigation
refactor: replace fromStart with since in log redirection - #908
Merged
Merged
Conversation
`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
|
See more at https://github.com/apify/apify-sdk-js/actions/runs/46880584691#summary-143458241485 |
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
fromStart with since in log redirection`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
…stein-3vuyel # Conflicts: # package.json
Pijukatel
marked this pull request as ready for review
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
marked this pull request as draft
December 2, 2026 09:18
Contributor
Author
|
Will be done after release. Only version of this minimal part needs to go before release: fa02bd5 |
barjin
changed the base branch from
master
to
refactor/remove-child-run-tracking
December 2, 2026 10:42
barjin
approved these changes
Dec 2, 2026
barjin
marked this pull request as ready for review
December 2, 2026 12:26
This was referenced Dec 2, 2026
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
apify-client3.0.0-beta.127 replaces thefromStartoption ofRunClient.getStreamedLog()withsince, so this pins it, updates the log redirection guide, and redirects the run log inActor.callTask()like inActor.call().