Repository navigation
fix(id): shell contract — join.device_input is nullable, as the host has always accepted - #12710
Merged
Merged
Conversation
…has always accepted The contract declaration for join.device_input (added in da4617d, hours after the field itself landed in #12281) said nullable: false, copied from the neighboring bool fields. But the host field is Option<Value> with serde(default): explicit null deserializes to None, exactly like an absent field, and every consumer treats the two alike (descriptive session metadata, not an authority grant). Every other Option-typed field in the contract is declared nullable (resume_token, screen_subscribe region/event_classes, the u64? shorthand). The declaration was the wrong side; the host behavior is the standing truth since #12281 and does not change. The contract document is corrected to describe it. No revision bump: declaring/correcting a field to match the host did not bump in da4617d either, and the wire protocol itself is unchanged. Fixes #12703. The named test shell_contract::tests::the_contracts_required_fields_are_exactly_what_the_host_requires failed on pristine main with "join.device_input: the contract and the host disagree about null (left: true, right: false)"; with this change the full id-worlds lib suite passes 911/911 and the web contract tests (world-contract, screen-codec, world-program) pass 33/33.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 4 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
One-line correction to
pkgs/id/contract/shell-contract.v1.json:join.device_inputis declared"nullable": true(wasfalse).Diagnosis — the contract declaration was the wrong side
device_input: Option<serde_json::Value>with#[serde(default)](crates/id-worlds/src/world_session/types.rs), landed in fix(id): validate forms against presenter input #12281 (a264773). Serde maps an explicit JSONnulltoNone— identical to the field being absent — and every consumer treats the two alike (descriptive session metadata, not an authority grant).nullable: falsecopied from the neighboring bool fields. Bools genuinely reject null;Option<_>fields do not. Every otherOption-typed field in the contract is declared nullable (resume_token,screen_subscriberegion/event_classes, theu64?shorthand onjoin.after).device_input: nullsince the field existed; the declaration misstated it. This change corrects the document to describe the host. The wire protocol does not change, and no revision bump: declaring/correcting a field to match the host did not bump in da4617d either.Evidence
cargo test -p id-worlds --lib the_contracts_required_fields_are_exactly_what_the_host_requires→ FAILED with the filed assertion (join.device_input: the contract and the host disagree about null, left: true, right: false, tests.rs:316).nix developinsidepkgs/id):cargo test -p id-worlds --lib→ 911 passed, 0 failed.bunx vitest run src/world-contract.test.ts src/screen-codec.test.ts src/world-program.test.ts→ 33 passed, 0 failed.Fixes #12703.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.