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
Goal
A single
useSyncExternalStoreadapter over the facade event stream (no independent writers) plus the Web3Auth Core Kit secret handoff. Replacesfolder.store+sync.store.Harvest / create
engine/snapshotStore.ts— subscribesnapshotUpdated/stalenessChanged, async-pullfacade.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.provideSecretfor failover.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 === 0post-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