You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(valkey): hscan raises on a field name that is not UTF-8 #7507
ValkeyClient.hscan in src/devops_cli/valkey/client.py decodes each field name with a strict bytes(name).decode() after the call returns, outside _call. A field name that is not UTF-8 raises UnicodeDecodeError. That is not a ValkeyError, so ValkeyCacheTier and its breaker let it through, and the read does not fail soft (ADR 0023 section 2). The field values decode with "replace", so only the names are at risk.
Each brain read goes through hscan (BrainIndex.watermark, and BrainIndex.items and tools of PR #7496). A UnicodeDecodeError from the brain digest stops the round of the alternatives check, because _settled catches only GitHubNotAnIssueError.
Reproduction Steps
HSET roadmap:v1:brain-item:acme/widgets:3 "\xff\xfe" x in the roadmap state store, where item 3 is a near item of item 7.
Run the alternatives check of item 7, or call read_digest(index, 7, ()).
Expected vs Actual Behavior
Expected: the read gives the fields with a replaced name, or the tier counts it as a store failure, and the digest is empty.
Actual: UnicodeDecodeError goes up through read_digest and stops the round.
Environment Diagnostics
Found in the review of PR #7496 on 2026-11-28 with a scratch script on its branch. No process of the project writes such a field name today, so only a hand-written key can cause it.
Fixed on main by #7517 (commit 0e2070a): ValkeyClient.hscan now decodes each field name with errors="replace" (src/devops_cli/valkey/client.py:335), and tests/valkey/test_valkey_cache_tier.py::test_the_cache_tier_reads_a_hash_whose_field_name_is_not_utf8 covers it.
Activity
dan-petty commentedon Nov 28, 2026
Both concern Valkey cache correctness, but #6611 fixes visibility and bounds while the candidate fixes field-name decoding in hscan.dan-petty commentedon Nov 28, 2026
Fixed on
mainby #7517 (commit 0e2070a):ValkeyClient.hscannow decodes each field name witherrors="replace"(src/devops_cli/valkey/client.py:335), andtests/valkey/test_valkey_cache_tier.py::test_the_cache_tier_reads_a_hash_whose_field_name_is_not_utf8covers it.