Skip to content

Invalid ?replay= code crashes the boot (fatal decode error) #159

Description

@mparrett

Problem

A malformed ?replay= code kills the web boot with a fatal error instead of degrading gracefully:

FATAL ERROR: "nth index out of bounds"
  :trace ("play-replay (main.lg:575:27)" "decode (main.lg:...)")
[program exited]

Repro: load the web build with ?replay=DEMO123 (any string that isn't a valid code). Nothing renders; the program exits.

Why it matters more now

#150 turns replay codes into shareable links surfaced in the config pane.
Shared links get truncated by chat apps, mistyped, or copied badly — a bad code will be a normal user input, and today it bricks the page until the param is hand-edited out of the URL.

Fix shape

replay/decode (or its play-replay caller) validates before use and fails soft: log or show "invalid replay code", then fall through to a normal boot (title screen) instead of exiting. Native --replay should get the same treatment if it shares the path.

Acceptance

  • ?replay=<garbage> boots to the title screen with an "invalid replay code" message (terminal or shell-visible), no fatal error.
  • A valid code still replays exactly as today.
  • A truncated valid code (drop the last few characters) also fails soft.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions