Skip to content

Decode an unclassified TYPE reply as RedisType.Other#153

Merged
ghostdogpr merged 1 commit into
mainfrom
fix-type-decode-unknown
Jul 2, 2026
Merged

Decode an unclassified TYPE reply as RedisType.Other#153
ghostdogpr merged 1 commit into
mainfrom
fix-type-decode-unknown

Conversation

@ghostdogpr

Copy link
Copy Markdown
Owner

RedisType was a closed enum of the six classic types (string, list, set, zset, hash, stream), and typeOf turned any other wire name into a DecodeError — failing the whole TYPE call. That breaks TYPE on keys of:

  • a preview type the library itself supports (the Arrays family, vector sets), and
  • any module type (e.g. ReJSON-RL).

Fix

Add an Other(name) case to RedisType and make fromWireName total: an unrecognized wire name now decodes to RedisType.Other(name) instead of erroring. wireName maps Other(name) back to its name, so it also round-trips as a SCAN ... TYPE filter argument.

Test

Updated the KeysSpec TYPE test: it now asserts an unclassified reply (ReJSON-RL) decodes to RedisType.Other("ReJSON-RL") rather than failing. Full core suite (697) passes.

RedisType was a closed enum of the six classic types, so typeOf turned any other
wire name into a DecodeError, failing the whole call. That breaks TYPE on keys of
a preview type the library itself supports (Arrays, vector sets) or any module
type (e.g. ReJSON-RL). Add an Other(name) case and make fromWireName total, so an
unrecognized type surfaces as RedisType.Other(name) rather than an error.
@ghostdogpr ghostdogpr force-pushed the fix-type-decode-unknown branch from 19ee930 to f408fa5 Compare July 2, 2026 07:23
@ghostdogpr ghostdogpr merged commit d12a94e into main Jul 2, 2026
9 checks passed
@ghostdogpr ghostdogpr deleted the fix-type-decode-unknown branch July 2, 2026 07:33
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