Repository navigation
feat!: reject IDs that cannot be part of a key-value store key - #2548
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## v2 #2548 +/- ##
=====================================
Coverage ? 95.56%
=====================================
Files ? 196
Lines ? 15528
Branches ? 0
=====================================
Hits ? 14840
Misses ? 688
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
id that is not a valid key
vdusek
marked this pull request as ready for review
November 30, 2026 12:44
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.
The
idof a crawler is now checked, so it can always be part of a key-value store key. The same check runs for an explicitidofSessionPool,StatisticsandDefaultRenderingTypePredictor, which use it in their keys too.idmust be at most 217 characters long and contain onlya-zA-Z0-9!-_.'(), otherwise the constructor raisesValueError. The limit leaves room for the longest key prefix,CRAWLEE_RENDERING_TYPE_PREDICTOR_STATE_(39 characters), within the 256-character key limit. Crawlee JS checks the same characters but allows 256, so its derived keys can be longer than a valid key.id, such as anintfrom v1, raisesTypeErrorthat names the class.Before, an
idlikea/bproduced keys likeCRAWLEE_STATE_a/b, which the Apify platform doesn't accept as keys.It's breaking, since an
idthat worked before can now raise. The new check replaces the first half oftest_id_invalid_as_request_queue_alias, because anidthat passes it always forms a valid RQ alias. The second half is kept as its own test.Closes: #2546
✍️ Drafted by Claude Code