Skip to content

web: land the useSyncExternalStore snapshot adapter and Core Kit login handoff #803

Description

@FSM1

Goal

A single useSyncExternalStore adapter over the facade event stream (no independent writers) plus the Web3Auth Core Kit secret handoff. Replaces folder.store + sync.store.

Harvest / create

  • engine/snapshotStore.ts — subscribe snapshotUpdated/stalenessChanged, async-pull facade.snapshot(focus), cache, notify; getSnapshot() returns the cache synchronously.
  • engine/useSnapshot.ts, engine/useStaleness.ts.
  • engine/loginHandoff.ts — Core Kit _UNSAFE_exportTssKey -> ArrayBuffer -> facade.start(buf) TRANSFERRED, then zero the JS copy; SecretSource.provideSecret for failover.
  • Thin stores/auth.store.ts (isAuthenticated/email/method only).

Rewire

DROP folder.store + sync.store — all rendered state now comes from the adapter.

Engine seams

start, subscribe, snapshot, setFocus.

Tests

Adapter caches/re-emits; zero independent writers; buffer byteLength === 0 post-transfer; no secret in storage/logs.

Gate

web unit.

Depends on

None — #882 (PR #889), #801 (PR #883) and #802 (PR #811) have all landed.

Blocks

#804, #805.

Part of #642

Metadata

Metadata

Assignees

No one assigned

    Labels

    comp:webpackages/client + apps/web — WASM host, browser seams, React UIv2-buildv2 rewrite build slice

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions