Skip to content

RFC: Product session restore host API #483

Description

@filvecchiato

Source PR: #71 · docs/rfcs/0016-product-session-restore.md · @replghost

Description

A product checkpoints its own session state into a reserved storage key and receives host lifecycle events, so it can flush before backgrounding, restart or force quit. The host owns storage, scheduling and retention; the product owns serialization.

Motivation

A host can reopen the product set but not the working context, so a product comes back to its start page with the draft, step or selection gone. No browser API serializes a live JS heap, so the state has to be semantic and product-written.

Requirements

  • host_session_lifecycle_subscribe delivers the events; state bytes go through the existing local-storage methods.
  • The reserved storage key is __truapi/session_restore/v1.
  • The blob carries an envelope version, a product schema version, and a Json or Cbor state payload.
  • Restore is best-effort with a cold-boot fallback, and state never reaches another product.

Tasks

  • RFC document body
  • Implementation — rust-core
  • Implementation — hosts
    • dotli
    • Desktop
    • iOS
    • Android
    • host-cli

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions