Unknown schema version or name kills the subscriber instead of being skipped #3

closed cmc opened this on 2026-09-04 03:56 UTC · milestone v0.5 — contract freeze

cmc 2026-09-04 03:56 UTC

README and the SCHEMA_VERSION doc say renderers "negotiate on connect and ignore records they do not understand." The code does the opposite.

In crates/signal-schema/src/lib.rs, decode_body returns None on a version mismatch or unknown SignalName discriminant. read_frame maps that None to io::Error(InvalidData). terminal-garden's run propagates it with ?, so the renderer exits on the first frame it does not understand. A v3 renderer against a v4 daemon dies immediately; a renderer built before a new metric was appended dies when that metric is first published.

Done when:

  • read_frame consumes the full frame (it already has body_len) and returns a distinguishable "skipped" outcome for a well-framed body it cannot decode, reserving Err for a truncated or unframeable stream.
  • terminal-garden continues past skipped frames.
  • A test encodes a frame with schema_version + 1 and one with an unassigned name discriminant, followed by a valid frame, and asserts the valid frame is still read.

closed by commit e5a591f952 by cmc: Skip frames the build cannot decode instead of killing the stream

2026-09-04 14:23 UTC