Conversation
…c v2-2026-10-01T153946Z - Add Build.getImageDigest() (spec apify-docs#3037). - Fix ScheduleClient.getLog(): was returning the raw response body as text; the endpoint returns a JSON envelope of ScheduleInvoked entries. - Fix DatasetClient.iterateItems() to paginate by the X-Apify-Pagination-Count scanned-row count (falling back to the returned count when the header is absent or implausibly low), fixing repeated/skipped items when combined with server-side item filters. - Add ApifyApiException subclasses by HTTP status (InvalidRequestError, UnauthorizedError, ForbiddenError, NotFoundError, ConflictError, RateLimitError, ServerError). - A 404 on a resource client reached through a run/build with no id of its own (run.dataset(), run.keyValueStore(), run.requestQueue(), run.log(), build.log()) now throws NotFoundError instead of resolving to empty/no-op. DatasetClient.getStatistics() and TaskClient.getInput() likewise throw on 404 instead of returning Optional.empty(). - Harden ResourceContext.toSafeId/encodePathSegment against path traversal (replace every slash, reject dot-only/empty path segments). - Skip request-body compression for content types that already carry their own compression (images, audio, video, archives, fonts). - Fix ApifyClientBuilder base URL normalization doubling /v2 when the caller already included it. - Add createItemsPublicUrl(options, expiresInSecs, format) overload. Bump Version.API_SPEC_VERSION to v2-2026-10-01T153946Z, CLIENT_VERSION to 0.7.0.
…s review feedback The X-Apify-Pagination-Count guard added in the previous commit discarded the reported scanned count whenever it was smaller than the returned item count. That is wrong for unwind, which legitimately returns more items than were scanned (one scanned row's array field splits into several output items) - the guard then advanced the offset by the larger returned count and silently dropped rows on the next page. Narrow the guard to only distrust a reported zero when the page also returned real items (the one combination that can never be genuine, since scanning zero rows can't produce items); any other nonzero reported value - including one smaller than the returned count - is now trusted, matching the reference client's behavior for both the filtered-page and unwind cases. Also: - Strengthen the getLog/getInput integration assertions to check decoded content instead of just non-null. - Add a regression test and MockTransport request-URL tracking covering the unwind case specifically (asserts the actual offset sent, since the mock otherwise serves scripted pages regardless of the request). - Consolidate the "flat zero observed on the live API" rationale to its one canonical location instead of restating it in five places.
This branch has not been deployed
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.
Syncs the Java client against the OpenAPI spec (
v2-2026-09-28T115051Z→v2-2026-10-01T153946Z, apify/apify-docs#3024, apify/apify-docs#3037) and the cross-language-relevant subset of the apify-client-js v3 rewrite (apify/apify-client-js#985 … #1104).Build.getImageDigest()(spec:Build.imageDigest).ScheduleClient.getLog(): it returned the raw response body as text, but the endpoint returns a JSON envelope ofScheduleInvokedentries.DatasetClient.iterateItems()to paginate by theX-Apify-Pagination-Countscanned-row count whenever that count is nonzero. This covers both server-side item filters andunwind, which can push the returned count above or below the scanned count. It falls back to the returned count only when the header reports an implausible0alongside real returned items, which was seen as a transient eventual-consistency artifact on the live API right after a write.ApifyApiExceptionsubclasses by HTTP status (InvalidRequestError,UnauthorizedError,ForbiddenError,NotFoundError,ConflictError,RateLimitError,ServerError).run.dataset(),run.keyValueStore(),run.requestQueue(),run.log(),build.log()) now throwsNotFoundErrorinstead of resolving to empty or no-op.DatasetClient.getStatistics()andTaskClient.getInput()likewise throw on 404 instead of returningOptional.empty().ResourceContext.toSafeId/encodePathSegmentagainst path traversal.ApifyClientBuilderbase URL normalization doubling/v2when the caller already included it.createItemsPublicUrl(options, expiresInSecs, format)overload.Bumps
Version.API_SPEC_VERSIONand bumpsVersion.CLIENT_VERSIONto0.7.0.Review:
/review-clientround 1 was rejected with one high-severity finding: the pagination guard brokeunwinditeration. It is fixed ind37d5b2together with a regression test and the remaining review items. Round 2 was Approved with no open items.Verified locally:
spotless:check,compile spotbugs:check,-Prelease package(javadoc), unit tests (164/164), integration tests (69/69, live API),ExamplesTest+DocSnippetsTest(8/8, live API). CItestis green ond37d5b2.