Skip to content

Force invalid types to binary terms when routing#432

Merged
whitfin merged 2 commits intomainfrom
issue-386
Feb 10, 2026
Merged

Force invalid types to binary terms when routing#432
whitfin merged 2 commits intomainfrom
issue-386

Conversation

@whitfin
Copy link
Copy Markdown
Owner

@whitfin whitfin commented Feb 10, 2026

This fixes #386.

In 4.x the Ring router accepts any key type, but will error if it doesn't implement the String.Chars protocol. If we detect that the key doesn't, then we'll convert it to a binary term prior to being hashed by ExHashRing.

This may not be a perfect fix, but it'll open the router to correctly align with the routing behaviour.

@whitfin whitfin added this to the v5.0.0 milestone Feb 10, 2026
@whitfin whitfin self-assigned this Feb 10, 2026
@whitfin whitfin added the bug label Feb 10, 2026
@whitfin whitfin merged commit 44ac7e4 into main Feb 10, 2026
18 checks passed
@whitfin whitfin deleted the issue-386 branch February 10, 2026 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document that keys must implement String.Chars when using Cachex.Router.Ring

1 participant