Skip to content

Support Redis clients created with decode_responses=True#22

Merged
lesnik512 merged 1 commit intomainfrom
support-decode-responses-clients
May 4, 2026
Merged

Support Redis clients created with decode_responses=True#22
lesnik512 merged 1 commit intomainfrom
support-decode-responses-clients

Conversation

@lesnik512
Copy link
Copy Markdown
Member

The CLAIM Lua reply is the binary BinaryMessageFormatV1 envelope, so a client with decode_responses=True would raise UnicodeDecodeError on every fetch — and because NACK_ON_ERROR leaves the timer in the timeline, every poison timer looped forever.

Route eval_cached through execute_command(..., NEVER_DECODE=[]) so the script reply stays raw regardless of the client's decode mode. zrangebyscore results were already tolerant of either return type via isinstance checks; just widen the annotations to list[bytes] | list[str]. Introduce a RedisClient type alias to thread the broader client type through the public surface.

The CLAIM Lua reply is the binary BinaryMessageFormatV1 envelope, so a
client with decode_responses=True would raise UnicodeDecodeError on every
fetch — and because NACK_ON_ERROR leaves the timer in the timeline, every
poison timer looped forever.

Route eval_cached through execute_command(..., NEVER_DECODE=[]) so the
script reply stays raw regardless of the client's decode mode. zrangebyscore
results were already tolerant of either return type via isinstance checks;
just widen the annotations to list[bytes] | list[str]. Introduce a RedisClient
type alias to thread the broader client type through the public surface.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@lesnik512 lesnik512 self-assigned this May 4, 2026
@lesnik512 lesnik512 merged commit d68e695 into main May 4, 2026
3 checks passed
@lesnik512 lesnik512 deleted the support-decode-responses-clients branch May 4, 2026 11:59
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.

1 participant