Title: id(world_net): read_worlds_reply reads a missing or mistyped 'default' as Ok("") — a malformed worlds reply silently lists no default world · Issue #6647 · developing-today/code · GitHub
Open Graph Title: id(world_net): read_worlds_reply reads a missing or mistyped 'default' as Ok("") — a malformed worlds reply silently lists no default world · Issue #6647 · developing-today/code
X Title: id(world_net): read_worlds_reply reads a missing or mistyped 'default' as Ok("") — a malformed worlds reply silently lists no default world · Issue #6647 · developing-today/code
Description: Bug WorldClient::read_worlds_reply (pkgs/id/src/world_net.rs:1213) — the shared reply parser behind the admin list_worlds and the public directory — reads the reply's top-level default field with a silent fallback: let default = reply["d...
Open Graph Description: Bug WorldClient::read_worlds_reply (pkgs/id/src/world_net.rs:1213) — the shared reply parser behind the admin list_worlds and the public directory — reads the reply's top-level default field with a...
X Description: Bug WorldClient::read_worlds_reply (pkgs/id/src/world_net.rs:1213) — the shared reply parser behind the admin list_worlds and the public directory — reads the reply's top-level default field wi...
Opengraph URL: https://github.com/developing-today/code/issues/6647
X: @github
Domain: github.com
IPv4 address: 140.82.113.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"id(world_net): read_worlds_reply reads a missing or mistyped 'default' as Ok(\"\") — a malformed worlds reply silently lists no default world","articleBody":"## Bug\n\n`WorldClient::read_worlds_reply` (`pkgs/id/src/world_net.rs:1213`) — the shared reply parser behind the admin `list_worlds` and the public `directory` — reads the reply's top-level `default` field with a silent fallback:\n\n```rust\nlet default = reply[\"default\"].as_str().unwrap_or_default().to_owned();\n```\n\nA `worlds` reply whose `default` is missing, `null`, or mistyped (number, boolean, array, object) reads as `Ok(\"\")` — an empty default name — with no error. The host's wire type makes this a malformed reply by construction: `ServerFrame::Worlds { default: &'a str, worlds: Vec\u003cWorldInfo> }` (`pkgs/id/src/world_session/types.rs:377-380`) always sends a string, and both host arms build it from `hub.default_world()` (`pkgs/id/src/world_session/mod.rs:943-968`).\n\nThis is the one top-level field of this reply the parser does not validate: the same function refuses a non-list `worlds` with `context(\"worlds reply had no list\")` (`world_net.rs:1214-1216`). (Per-entry drops in the same function are #6621 — different fields, already filed; this issue covers only the top-level `default`.)\n\n## Evidence (verified this run, laptop @ fff580fb1e)\n\nProbe `~/git/fleet/probe-worlds-default-wt` (real `id` crate, integration test `pkgs/id/tests/probe_worlds_default.rs` in the probe worktree only; scripted iroh host answering `list_worlds` with canned frames, harness reused from the #6621 probe), `cargo test --test probe_worlds_default` — **1 passed**:\n\n- Control — `{\"type\":\"worlds\",\"default\":\"lobby\",\"worlds\":[lobby, arena]}` → `Ok((\"lobby\", [(\"lobby\", true, 3), (\"arena\", false, 0)]))`.\n- `default` missing → `Ok((\"\", [both worlds]))`.\n- `default`: `123` / `true` / `[]` / `{}` / `null` → each `Ok((\"\", [both worlds]))`. Every malformed shape collapses to the same empty string.\n- Oracle — `\"worlds\": {...}` (not a list) → `Err(\"worlds reply had no list\")`, confirming the function does refuse top-level shape errors for the sibling field.\n\n## Why it matters\n\n- `id world list` is the operator's view of which world is the host's default. With `default` silently `\"\"`, the plain listing marks **no** world with the `(default)` marker (`commands/world.rs:77-83` selects the marker by raw-name equality with the default string), and `--json` output prints `\"default\": \"\"` with every entry's `default` flag `false` (`world_hub::directory_json`, `pkgs/id/src/world_hub.rs:161-176`).\n- The public `directory()` path shares the parser, so the same malformed reply quietly publishes a directory with no default world — a version-skewed or buggy host degrades the listing invisibly instead of failing loudly, exactly the failure mode the function's own `worlds`-list check guards against.\n- A consumer comparing the returned default against a real world name cannot distinguish \"host has an empty-named default\" from \"host sent garbage\": the malformed-reply signal is destroyed at the parser.\n\n## Acceptance criteria\n\n- [ ] A `worlds` reply whose `default` is missing or not a string makes `list_worlds` / `directory` fail with an error naming the field (e.g. \"worlds reply had no default world\"), mirroring the existing \"worlds reply had no list\" check.\n- [ ] A well-formed reply returns the host's default name unchanged; an explicitly empty-string default from a conforming host, if triage decides it is legitimate, is a deliberate documented case, not a fallback for malformed shapes.\n- [ ] A regression test drives `list_worlds` (or `directory`) against a scripted host covering: string default (control), missing default, and at least number + null mistyped defaults.\n- [ ] No change to the per-entry handling (#6621), the refusal path, or the `ServerFrame::Worlds` wire shape.\n\nRelated (same function/file, different fields — not this issue): #6621 (per-entry drops + presence), #6620 (compile reply defaults), #6632 (create_world `created` default).\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-11-07T00:33:06Z","url":"https://github.com/developing-today/code/issues/6647"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:04bbe125-f461-30ef-db8f-110562a78ed9 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B13C:83E67:32930D:44E893:6B0763CD |
| html-safe-nonce | f5066eb07ccaf0850d627d038cb1e5313afc6c42eda315587da93adf69ff9af3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMTNDOjgzRTY3OjMyOTMwRDo0NEU4OTM6NkIwNzYzQ0QiLCJ2aXNpdG9yX2lkIjoiNDQ4MDcwMjM1NTM1MjI4MjA2MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 083e1fd3938f4892c721aa47b26b47772230e99f648ad5952729037105bde2db |
| hovercard-subject-tag | issue:6253185523 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/developing-today/code/6647/issue_layout |
| twitter:image | https://opengraph.githubassets.com/28fc04383dfed160b7243cb4799572f06dae0d0c115d11e373819d464b63ac97/developing-today/code/issues/6647 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/28fc04383dfed160b7243cb4799572f06dae0d0c115d11e373819d464b63ac97/developing-today/code/issues/6647 |
| og:image:alt | Bug WorldClient::read_worlds_reply (pkgs/id/src/world_net.rs:1213) — the shared reply parser behind the admin list_worlds and the public directory — reads the reply's top-level default field with a... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dezren39 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7a557ecc960a3ae6e299fc66b0bc9132072f8860191648e6749fee5d3ff00d82 |
| turbo-cache-control | no-preview |
| go-import | github.com/developing-today/code git https://github.com/developing-today/code.git |
| octolytics-dimension-user_id | 26439447 |
| octolytics-dimension-user_login | developing-today |
| octolytics-dimension-repository_id | 627308783 |
| octolytics-dimension-repository_nwo | developing-today/code |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 627308783 |
| octolytics-dimension-repository_network_root_nwo | developing-today/code |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | bd845eb7947c1ed8c850f7ab415a51339d162de3 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width