Skip to content

js/net: expose typed announcement status instead of active boolean (AI review) #2216

Closed as not planned

Description

@kixelated

Problem

Rust models announcement updates as Active, Restart, and Ended, and the wire format carries all three states. The public JS API reduces this to { path, active: boolean }, so Restart becomes indistinguishable from a normal active announcement.

That loses protocol information and makes it hard to add restart-specific behavior later without another API change.

Suggested direction

Expose a discriminated status such as "active" | "restart" | "ended" in Announced.Event. This is a breaking shape change, so the dev merge is the inexpensive time to make it. Keep any boolean helper as derived convenience rather than the canonical event shape.

(Written by GPT-5)

Activity

  1. coderabbitai commented on Jul 13, 2026

    @coderabbitai
    Contributor
    🔗 Related PRs

    #610 - Add Rust compatibility for draft-07. [closed]
    #645 - Add more compatibility for draft 14 [closed]


    📝 Issue Planner

    Check the box below or use the @coderabbitai plan command to generate an implementation plan and prompts that you can use with your favorite coding assistant.

    • Create Plan

    🧪 Issue enrichment is currently in open beta.

    You can configure auto-planning by selecting labels in the issue_enrichment configuration.

    To disable automatic issue enrichment, add the following to your .coderabbit.yaml:

    issue_enrichment:
      auto_enrich:
        enabled: false

    💬 Have feedback or questions? Drop into our discord!

  2. added
    questBeing tracked/planned in a quest. See `quest/`
    on Sep 7, 2026
  3. kixelated commented on Sep 8, 2026

    @kixelated
    CollaboratorAuthor

    Closing as stale after a review of the quest that tracked it.

    Both public models already carry exactly two states. In Rust, OriginAnnounce.broadcast is Option<broadcast::Consumer>: a replacement is delivered as None followed by Some, and a route change alone is invisible there (observe it through broadcast::Consumer::route_changed). In js/net, Announced.Event is { path, active }, the same two states.

    The third wire state, ANNOUNCE_RESTART (the draft's ANNOUNCE_UPDATE), atomically updates a live route's hop chain and cost so a relay failover or a resume never looks like new content. It is plumbing beneath the model and never reaches a consumer in either language, which is what route migration relies on. Exposing it as a typed status would put a wire detail into the public model for no consumer that needs it.

    Quest quest/m1/2216-js-net-typed-announce-status.md is deleted in #3541 and the quest label removed.

    (written by Claude Fable 5.1)

  4. removed
    questBeing tracked/planned in a quest. See `quest/`
    on Sep 8, 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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions