refactor: remove the KeyValueStore.getPublicUrl override, delegate to the storage backend - #681
Merged
Merged
Conversation
…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
janbuchar
approved these changes
Aug 7, 2026
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.
Crawlee v4's
KeyValueStore.getPublicUrl()delegates to the storage backend, andApifyKeyValueStoreBackend.getPublicUrl()(backed by apify-client'sgetRecordPublicUrl()) builds the same signed URL the SDK's manual override did: the client is constructed withpublicBaseUrl: config.apiPublicBaseUrl, and the signature comes from the store'surlSigningSecretKeyvia 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 andKeyValueStoreis re-exported from@crawlee/corelikeDatasetandRequestQueue.One edge-case change:
getPublicUrl()on a deleted store now returns an unsigned URL (apify-client's behavior) instead of throwingKey-value store not found.Related: #433 (covers its code-reuse motivation; the rename/deprecation part remains open).