Skip to content

fix(server): announce the boot auth state after the initial session restore - #571

Open
johnthecat wants to merge 2 commits into
mainfrom
fix/announce-boot-auth-state
Open

fix(server): announce the boot auth state after the initial session restore#571
johnthecat wants to merge 2 commits into
mainfrom
fix/announce-boot-auth-state

Conversation

@johnthecat

Copy link
Copy Markdown
Contributor

Problem

A pairing host boots with no answer on the auth callback when there is nothing to restore. The core restores the persisted session on its own at boot, but a signed-out boot is a no-op transition and emits nothing, so a host cannot tell "still restoring" from "signed out". polkadot-desktop worked around it by guessing Disconnected after a timeout, which flashed onboarding at paired users and burned a pairing on every cold start (paritytech/polkadot-desktop#848).

Solution

The boot tick of the session-store sync announces its outcome once it has reconciled, Disconnected included. The auth callback therefore always opens with the real boot state: Connected for a restored session, Disconnected otherwise, with nothing emitted before it. Explicit activateStoredSession keeps its behaviour and never double-emits.

Docs for AuthPresenter, the native HostCallbacks, and the @parity/truapi-host README describe the contract; the codegen golden is regenerated accordingly. Tests cover the signed-out boot, the restored boot, and the invalid-blob boot.

…estore

The session-store sync's boot tick now calls announce_current after
reconciling, so a pairing host receives an opening AuthState
(Disconnected included) without calling activateStoredSession.
@johnthecat
johnthecat requested a review from a team September 2, 2026 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant