GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — id(web/world): session-WS records frame shape-trusted — a string records renders per-character entries, a non-string next_after is echoed back as the pagination cursor · Issue #7908 · developing-today/code

id(web/world): session-WS records frame shape-trusted — a string records renders per-character entries, a non-string next_after is echoed back as the pagination cursor #7908

New issue
Copy link
New issue
Copy link
Closed
#8649
Closed
id(web/world): session-WS records frame shape-trusted — a string records renders per-character entries, a non-string next_after is echoed back as the pagination cursor#7908
#8649
Copy link
Labels
app/idPackage/app: id (pkgs/ or apps/ in this repo)effort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobtask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

Description

@developing-today
developing-today
bot
opened on Nov 9, 2026
Issue body actions

id(web/world): session-WS records frame is shape-trusted — a string records renders per-character entries, a non-string next_after is echoed back as the pagination cursor

Summary

On the world page, the session WebSocket's records frame handler in
pkgs/id/web/src/world.ts trusts the frame's shape, unlike its sibling
handlers in the same receive() switch. A wrong-shape frame from the
server (stale/buggy host, middlebox, or a future server change) is not
rejected: its payload is merged and rendered as if it were the world's
records, and a malformed pagination cursor is sent straight back to the
server as the next page request.

Evidence (verified on main @ 1f5ac11)

pkgs/id/web/src/world.ts:

  • The frame is accepted with a bare cast — line 199: const frame = parsed as WorldFrame; — and the declared contract is records?: Record<string, unknown> / next_after?: string | null (lines 37–38).
  • Sibling cases validate before use: snapshot is checked with isWorldSnapshot (line 203) and event with isWorldEvent (line 223); failures go to rejectFrame() (line 176).
  • The records case (line 267) has no equivalent guard:
    • line 272: for (const [k, v] of Object.entries(frame.records ?? {})) — Object.entries on a string yields per-character entries, on an array per-index entries, on a number/boolean nothing at all.
    • line 275: recordsAfter = frame.next_after ?? null; — any non-null value, whatever its type, becomes the cursor, and lines 286–293 send it back verbatim as after in the next records request.

Reproduction (probe on the laptop, ~/git/fleet/probe-records-ws-frame-20261108,
real world.ts driven through the same FakeWebSocket harness as
world-records.test.ts; probe copy byte-identical to main, 6/6 tests pass —
the BUG cases assert the current wrong behavior):

  • Control: {type:"records", records:{a1:1}, next_after:null} renders {a1: 1} and terminates the fetch. ✔
  • records: "abc" → renders {"0":"a","1":"b","2":"c"} — per-character junk presented as world records.
  • records: [10, 20] → renders {"0":10,"1":20}.
  • records: 42 → the fetch silently completes rendering {} — the world's records look empty.
  • next_after: 123 → the client sends the follow-up page request with after: 123 (a number, not a string).
  • next_after: {k: 1} → the client sends after: {"k": 1} verbatim.

Existing tests do not cover this: pkgs/id/web/src/world-records.test.ts
covers the #1458 pagination coalescing and the #2953 __proto__
define-semantics, but every delivered frame has a well-shaped records
object and a string/null next_after. The baseline suite is green
(6/6 in the probe).

Why it matters

The records panel is how a participant reads the world's published
state. A single wrong-shape frame currently (a) fabricates records that
do not exist (per-character/per-index entries), (b) silently reports an
empty world for scalar payloads, and (c) corrupts the pagination
protocol by echoing a non-string cursor the server never issued —
against a server that treats an unknown cursor as a first page, that
also re-merges page one and can keep the fetch alive past the page the
server meant to end it on. The snapshot/event cases in the same switch
already show the house pattern: validate, and rejectFrame() on a
mismatch instead of rendering it.

Related but distinct: #7833 covers the REST /api/world/host-view
path in the same file (refreshHostView, a different function and
transport); this issue is the session-WebSocket records frame in
receive(). A fixer may reasonably handle both in one pass. The
Rust-side cursor-shape fixes (#6615, #6778, #6600) and open #6578 cover
server-side readers, not this browser handler.

Acceptance criteria

  • A records frame whose records is not a plain object (string, array, number, boolean) is rejected (e.g. via the existing rejectFrame() path) and does not change the rendered records or the fetch state.
  • A records frame whose next_after is neither a string nor null/undefined is rejected the same way; a non-string cursor is never sent back to the server as after.
  • Well-formed frames behave exactly as today: the id(web): world records view shows a lone stale page when an input event restarts a paginated fetch — fresh pages are silently discarded #1458 coalescing/refetch behavior and the Design: define, don't assign — untrusted keys are stored with define semantics, never through the __proto__ setter #2953 define-semantics key handling in world-records.test.ts stay green.
  • New tests in world-records.test.ts (or a sibling suite) deliver string/array/numeric records and numeric/object next_after frames and pin the rejection.

Activity

  1. developing-today
    added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests
    status/needs-triageNot yet triaged; needs a first look
    source/creatorFiled by the new-issue-creator job
    priority/normalOrdinary priority (the default)
    queue/queuedHas a queued queue task
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    effort/sSmall: expected under 2 hours of work
    on Nov 9, 2026
  2. developing-today commented on Nov 9, 2026

    @developing-today
    developing-todayBot
    on Nov 9, 2026 – with developing.today
    ContributorAuthor
    More actions

    🤖 Agent note · filed

    • Agent: new-issue-creator job (lane A, slug new-issue-creator-code-a)
    • Session / ID: cron job new-issue-creator-code-a, run 2026-11-08 19:35 CST
    • Found via: filed this run
    • Task: Validate the session-WS records frame shape in pkgs/id/web/src/world.ts receive() — reject a non-object records and a non-string next_after instead of rendering/echoing them.
    • Expectation: effort/s — done when the acceptance criteria in the issue body pass and the existing world-records.test.ts suite stays green.
    • Links: verification probe on the laptop at ~/git/fleet/probe-records-ws-frame-20261108 (real world.ts, byte-identical to main @ 1f5ac11; 6/6 probe tests pass asserting the current wrong behavior; baseline world-records.test.ts 6/6 green). Filed via the developing.today GitHub App (user token GraphQL rate-limited). Related, distinct transport: issue id(web/world): /api/world/host-view and /api/world/invite responses shape-trusted — a wrong-shape 200 shows raw TypeErrors, renders bogus per-character records, or persists a fake 'undefined' invite capability #7833 (REST host-view).
  3. dezren39
    added
    queue/claimedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    and removed
    status/needs-triageNot yet triaged; needs a first look
    queue/queuedHas a queued queue task
    on Nov 11, 2026
  4. dezren39 commented on Nov 11, 2026

    @dezren39
    dezren39
    on Nov 11, 2026
    Member
    More actions

    agent-note:v1
    lane: code-j
    task: 14271
    issue: #7908
    state: triaged
    note: Inline triage by lane code-j (runbook section 1c): work kind task/small-fix, priority/normal, effort/s, kind/bug - all already labelled and confirmed against the issue body (session-WS records frame in pkgs/id/web/src/world.ts shape-trusted, unlike the guarded snapshot/event sibling cases). Removed status/needs-triage; claim labels synced. First concrete step: add an isWorldRecords-style guard beside isWorldSnapshot/isWorldEvent - records must be a plain object and next_after a string or null/undefined - routing failures to the existing rejectFrame() path. Acceptance check: wrong-shape frames change no rendered records or fetch state and a non-string cursor is never echoed; existing world-records tests stay green; new tests pin string/array/numeric records and numeric/object next_after rejection. Continuing to the fix in this same session.

  5. dezren39 commented on Nov 11, 2026

    @dezren39
    dezren39
    on Nov 11, 2026
    Member
    More actions

    agent-note:v1
    lane: code-j
    task: 14271
    issue: #7908
    stage: parked
    note: Task 14271 parked as CI wait on PR #8510. Triaged inline and fixed in the same session by lane code-j: isWorldRecordsFrame guard in pkgs/id/web/src/world.ts validates the session-WS records frame (plain-object records, string-or-null next_after) with failures routed to rejectFrame(), matching the snapshot/event siblings; new world-records test pins string/array/numeric/boolean records and numeric/object next_after rejection. Tests: world-records 7/7 pass, typecheck clean, full web suite 712 pass with the single pre-existing search-panel failure (proven on clean main). Resume: PR #8510 checks green + Codex clean, then merge (closes this issue).

  6. dezren39
    added
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    queue/claimedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    and removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Nov 11, 2026
  7. dezren39
    added a commit that references this issue on Nov 11, 2026

    Merge pull request #8649 from developing-today/queue/14271-7908-world…

    725d0a6
  8. dezren39
    closed this as completedin #8649on Nov 11, 2026
  9. dezren39 commented on Nov 11, 2026

    @dezren39
    dezren39
    on Nov 11, 2026
    Member
    More actions

    🤖 Agent note · done — wrong-shape records frames rejected; PR #8649 merged, issue closed

    • Agent: queue worker (repo-worker-code), lane code-c
    • Session / ID: task 14271
    • Found via: queue claim · lane code-c (execution lane: direct)
    • Result: PR fix(id/web): reject wrong-shape session-WS records frames (#7908) #8649 MERGED (merge sha 725d0a6, 2026-11-11T11:06:12Z); this issue CLOSED via Fixes #7908. pkgs/id/web/src/world.ts receive() now validates the records frame with a new isWorldRecords guard (records a plain object when present; next_after string-or-null) before any merge or cursor adoption, matching the snapshot/event siblings' rejectFrame() discipline — rejection changes neither rendered records nor fetch state. Regression test added to world-records.test.ts in the same style as the existing snapshot/event rejection tests.
    • Verification: world-records.test.ts 7 pass / 0 fail (incl. id(web): world records view shows a lone stale page when an input event restarts a paginated fetch — fresh pages are silently discarded #1458 coalescing and Design: define, don't assign — untrusted keys are stored with define semantics, never through the __proto__ setter #2953 define-semantics); tsc --noEmit clean; the one full-suite failure (search-panel.test.ts) verified identical on a pristine worktree of origin/main — pre-existing. Codex review: no findings. PR checks were still pending in the Actions runner stall at merge; merged under the standing merge-when-verified authority.
    • Links: task 14271 · PR fix(id/web): reject wrong-shape session-WS records frames (#7908) #8649 · issue id(web/world): session-WS records frame shape-trusted — a string records renders per-character entries, a non-string next_after is echoed back as the pagination cursor #7908
  10. dezren39
    removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    on Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    app/idPackage/app: id (pkgs/ or apps/ in this repo)effort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobtask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.