Skip to content

refactor: remove the KeyValueStore.getPublicUrl override, delegate to the storage backend - #681

Merged
B4nan merged 1 commit into
v4from
claude/vigilant-chaum-5f3dc7
Aug 7, 2026
Merged

refactor: remove the KeyValueStore.getPublicUrl override, delegate to the storage backend#681
B4nan merged 1 commit into
v4from
claude/vigilant-chaum-5f3dc7

Conversation

@B4nan

@B4nan B4nan commented Aug 7, 2026

Copy link
Copy Markdown
Member

Crawlee v4's KeyValueStore.getPublicUrl() delegates to the storage backend, and ApifyKeyValueStoreBackend.getPublicUrl() (backed by apify-client's getRecordPublicUrl()) builds the same signed URL the SDK's manual override did: the client is constructed with publicBaseUrl: config.apiPublicBaseUrl, and the signature comes from the store's urlSigningSecretKey via the same HMAC. I compared both implementations directly (signed, unsigned, and custom base URL) and the outputs are byte-identical. Local stores are unaffected, since both paths run the same core delegation.

With the override gone, the subclass was an empty shell (just a return-type-narrowing open()), so the file is removed and KeyValueStore is re-exported from @crawlee/core like Dataset and RequestQueue.

One edge-case change: getPublicUrl() on a deleted store now returns an unsigned URL (apify-client's behavior) instead of throwing Key-value store not found.

Related: #433 (covers its code-reuse motivation; the rename/deprecation part remains open).

…to the storage backend

Crawlee v4's `KeyValueStore.getPublicUrl()` delegates to the storage
backend, and `ApifyKeyValueStoreBackend.getPublicUrl()` (backed by
apify-client's `getRecordPublicUrl()`) produces the exact same signed
URL as the SDK's manual override did — same public base URL (the client
is constructed with `publicBaseUrl: config.apiPublicBaseUrl`) and same
HMAC signature from the store's `urlSigningSecretKey`. Local stores keep
their behavior too, since both paths run the same core delegation.

With the override gone the subclass was an empty shell, so it is removed
entirely and `KeyValueStore` is re-exported from `@crawlee/core`, same
as `Dataset` and `RequestQueue`.

Related: #433
@B4nan B4nan 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 Aug 7, 2026
@B4nan
B4nan requested a review from janbuchar August 7, 2026 11:19
@B4nan
B4nan merged commit 26bda58 into v4 Aug 7, 2026
7 checks passed
@B4nan
B4nan deleted the claude/vigilant-chaum-5f3dc7 branch August 7, 2026 11:56
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants