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
Commit d76b08e
Browse filesBrowse the repository at this point in the historyBrowse files
fix(ui): reject blank required strings in Control UI update readers
The Control UI update readers accepted `""` for fields the canonical
UpdateAvailableSchema/UpdateScheduleStateSchema declare as NonEmptyString,
so a malformed Gateway payload rendered an update banner with blank
version text.
Root cause is the reader treating "is a string" as the contract for
fields whose canonical contract is "is a non-empty string". Fixed at that
boundary with the protocol's own dependency-free `isNonEmptyProtocolString`
primitive: required NonEmptyString fields now reject the payload when
blank, and optional ones are dropped rather than discarding the whole
payload.
Deliberately does NOT re-derive the canonical schema in the browser:
- `additionalProperties: false` is a producer-side contract the Gateway
enforces on its own outbound results (src/gateway/server-methods/update.ts).
Rejecting unknown keys client-side would turn every additive protocol
field into a blank overlay, since a service-worker-cached document keeps
an older bundle across a Gateway upgrade.
- Canonical `maxLength` counts grapheme clusters (typebox 1.3.6
guard/string.mjs), so the previous `subject.length <= 120` copy dropped
valid emoji subjects the schema accepts. The bound is producer-side and
is gone rather than approximated.
- typebox itself stays out of this module: it is in the Control UI startup
graph, which has a hard gzip budget (scripts/check-control-ui-performance.mts).
Drift is now pinned in tests instead of duplicated in production: the
boundary suite runs fixtures through both the reader and Value.Check over
the canonical schemas, asserting that anything the schema accepts still
reaches the overlay.
Production LOC: net -7 against main.
0 commit comments