Skip to content

fix(geo): report a missing member in *BYMEMBER searches instead of crashing - #594

Merged
cunla merged 2 commits into
cunla:masterfrom
kratos0718:geo-missing-member
Sep 30, 2026
Merged

cunla merged 2 commits into
cunla:masterfrom
kratos0718:geo-missing-member

Conversation

@kratos0718

Copy link
Copy Markdown
Contributor

Searching around a member that is not in the set passed its score (None) to geo_decode, so GEORADIUSBYMEMBER, GEORADIUSBYMEMBER_RO, GEOSEARCH ... FROMMEMBER and GEOSEARCHSTORE ... FROMMEMBER raised a Python TypeError: 'NoneType' object is not iterable. It happened for a missing key too.

A real Redis 8.10 answers ERR could not decode requested zset member when the key exists but the member does not, and an empty result ([], or 0 for the store variants) when the key does not exist. Both paths now go through one _member_position helper that does the same. The new test passes against the real server (Strict2/Strict3) and fails on master for FakeStrict2/FakeStrict3.

…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.
@kratos0718
kratos0718 requested a review from cunla as a code owner September 29, 2026 17:06
@cunla
cunla merged commit 992f311 into cunla:master Sep 30, 2026
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants