Skip to content

fix(id): fail worlds listings on malformed entries instead of silently dropping them (#6621) - #6727

Merged
dezren39 merged 1 commit into
mainfrom
queue/fallback-6621-worlds-entry-validation
Nov 7, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/fallback-6621-worlds-entry-validation

Conversation

@dezren39

@dezren39 dezren39 commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

Fixes #6621.

WorldClient::read_worlds_reply — the shared parser behind list_worlds and the public directory — validated the reply's top level but silently discarded per-entry shape failures via filter_map, and read a mistyped presence as 0 via unwrap_or(0). A world whose entry arrived malformed (host bug, version skew) vanished from the admin inventory while still being served, and a fabricated presence: 0 invited exactly the operations an occupied world should not get.

Change (pkgs/id/src/world_net.rs)

  • The reply tail is factored into parse_worlds_reply (the parse_module_info_reply / parse_create_world_reply precedent), and every entry is validated in its wire shape: the host's WorldInfo always serializes name (string), open (bool), and presence (count), so a missing or mistyped field — or a non-object entry — fails the whole listing with an error naming the entry index and field. This is the design Design: a reply is not its defaults — one validated-reply contract for the WorldClient #6669 Phase 3 pin (rule 4: a listing is complete or it errors); the partial-listing alternative was rejected there. The refusal path, the non-list worlds check, and the strict default check (id(world_net): read_worlds_reply reads a missing or mistyped 'default' as Ok("") — a malformed worlds reply silently lists no default world #6647) are unchanged, and well-formed replies return exactly the host's entries.
  • Regression test worlds_reply_rejects_malformed_entries drives the factored parser: well-formed control, five malformed shapes (non-object entry, mistyped name, mistyped open, mistyped presence, missing presence) each asserting the entry/field is named, plus the refusal and top-level paths. Oracle: the parser's own top-level strictness.

Verification (laptop, worktree @ 9bb7e0d)

  • worlds_reply_rejects_malformed_entries ok; sibling parser tests (create_world_reply_requires_created_flag, info_details_rejects_malformed_active_module_hash) ok.
  • Live-host listing tests still pass against the strict parser: only_an_admin_creates_or_lists_worlds ok and directory_frame_lists_worlds_without_an_admin_token ok.
  • rustfmt clean on pkgs/id/src/world_net.rs.

Filed from a fallback-mode queue shift (queue backend down, code#6619): claimed and released via fleet-claim markers on #6621 by repo-worker-code-l.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@dezren39
dezren39 requested a review from a team as a code owner November 7, 2026 03:23
@coderabbitai

coderabbitai Bot commented Nov 7, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You'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 15 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f11a30b5-d299-4180-9631-8c04a709ef58
Commits

Reviewing files that changed from the base of the PR and between 6acb50a and 9bb7e0d.

Files selected for processing: 1

  • pkgs/id/src/world_net.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-07T03:25:14.139315Z 9bb7e0d PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant