Repository navigation
fix(geo): report a missing member in *BYMEMBER searches instead of crashing - #594
Merged
Merged
Conversation
…ashing GEORADIUSBYMEMBER[_RO] and GEOSEARCH[STORE] ... FROMMEMBER passed the missing member's score (None) to geo_decode, which raised a TypeError. Redis answers 'could not decode requested zset member' when the key exists, and an empty result when the key does not.
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.
Searching around a member that is not in the set passed its score (
None) togeo_decode, soGEORADIUSBYMEMBER,GEORADIUSBYMEMBER_RO,GEOSEARCH ... FROMMEMBERandGEOSEARCHSTORE ... FROMMEMBERraised a PythonTypeError: 'NoneType' object is not iterable. It happened for a missing key too.A real Redis 8.10 answers
ERR could not decode requested zset memberwhen the key exists but the member does not, and an empty result ([], or0for the store variants) when the key does not exist. Both paths now go through one_member_positionhelper that does the same. The new test passes against the real server (Strict2/Strict3) and fails on master for FakeStrict2/FakeStrict3.