protocol: name every arm instead of letting absence mean one #342
No reviewers
Labels
No labels
priority/P0
priority/P1
priority/P2
release/v0.1.0
status/blocked
status/planned
type/bug
type/design
type/test-gap
type/tracker
No milestone
No project
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set
Reference
natsukium/felis!342
Loading…
Reference in a new issue
No description provided.
Delete branch "issue-327"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #327
In proto3 a field a peer omitted and a field a peer never knew are the
same bytes, so any union whose unset state carries meaning reads an arm
added after the freeze as whatever the schema nominated as its default.
An old decoder then performs a real operation in place of the one it
could not understand. The first public baseline is the last point at
which naming every arm is free, so all four remaining cases get named
arms: RetargetTarget.carrier gains default_local, SessionAttach's id and
id_prefix become a target oneof at their current numbers, and
GridThemeColor takes the set/reset shape GridPaletteColor already had.
OpsStop.mode already had if_empty; only its decoder defaulted.
Rejected: keeping unset as the default arm, which reads well because the
common case costs no bytes and a producer writing nothing gets the safe
posture. It makes a frame the decoder could not understand identical to
one that meant the default, and those two want opposite answers; it also
puts the default in the reader, so peers built a minor apart disagree
about what was asked while both decode cleanly. SwitchScope already
refused an unset union, and one policy across the families is what keeps
a reader from having to remember which family is which.
Refs #327.
Review
pi luna and sol reviews on the pre-rebase commit both passed (non-blocking findings folded: BREAKING.md now describes the one-sided skew, and the stale
ThemeColor.rgbdoc comment is gone). Rebased onto #340/#341;just proto-compat, fmt-check, prose-check, clippy and the Windows cross clippy pass locally. The workspace test run shows only the pre-existing socket-path-length failures on this machine (felis-cli cli_bridge lost-daemon / relative-cwd, felis-daemon racing teardown / parked peer).The Criterion regression gate is a known-flaky bench job and fails on every PR.
d0fc665ec89093211109