Skip to content

state/navigation: the store core owns connect/onReady and the shutdown convergence timer; host-driven lifecycle debt before any second adapter #1591

Description

@obra

D14-2 (#1584) moved the navigation store core into the package verbatim, so it kept two shapes the D5/D6 cores deliberately do not have:

  1. NavigationClient = Pick<AppwireClientLike, "connect" | "request" | "onNotification" | "onReady">: init() calls client.connect() when no initialize is handed in (store.ts:806-814) and subscribes to client.onReady itself to detect reconnects/generation changes (:759-805). D5/D6 expose beginReadyGeneration/endReadyGeneration/detachHub and let the adapter drive them from connectionStore; the web host (notifications/index.ts:132-142) already tracks readiness and only calls initNavigation(client) once ready, so the core re-derives what the host knows.
  2. awaitConvergence (:830-893) with its own setTimeout, NAVIGATION_INVALIDATION_TIMEOUT_MS = 10s and rearm loop has one caller, the web's shutdownConvergence.ts; the bound is shutdown UX policy, not a navigation invariant, and everything it needs is public except the private isNavigationNotInitialized matcher.

Neither belonged in #1584 (its contract was "core unchanged, oracle byte-identical"). Pay before building any second adapter on this core: host-driven generation lifecycle in the D5 shape (port shrinks to request + onNotification), and decide whether the convergence timer moves to the web's shutdown flow with the matcher exported. Also: awaitNavigationTargets (:132, :542-545) has no production caller (two test files only) and crossed into the public API with the move. Found by the /simplify altitude pass on #1584.

Activity

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

    P4Priority 4 (carried from kata; 0 = highest)architectureComponent boundaries, responsibility and state ownershipcomplexity/LLarge: cross-module, needs sequencing/migration, or >2 packagesenhancementNew feature or requestneeds-designRequires a design or architecture ruling before work can startneeds-human-reviewRequires human review or a ruling before implementation can startsdkShared AppWire SDK package work

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions