chore(vendor): bump sphere-sdk to eea87ca (PR #331 — issue #330 browser durability)#324
Merged
vrogojin merged 1 commit intoMay 29, 2026
Conversation
…er durability) Vendor bump from `0.7.5-sdk-8ebba68` → `0.7.5-sdk-eea87ca`. Pulls in [sphere-sdk PR #331](unicity-sphere/sphere-sdk#331) which addresses [issue #330](unicity-sphere/sphere-sdk#330) — browser Profile loses all tokens on reload — via three architectural fixes plus a follow-up commit addressing all blockers from an adversarial code review: 1. **`profile/orbitdb-adapter.ts`** — install `IDBBlockstore` (from `blockstore-idb@^4.0.1`) for browser Helia so OpLog + CAR blocks persist across page reloads. Pre-fix Helia fell through to its default `MemoryBlockstore` and every block evaporated on tab unload. Configurable via `OrbitDbConfig.browserBlockstorePath` (default `'sphere-helia-blocks'`). Includes a 5s timeout on `open()` so a stuck IDB upgrade doesn't hang init. 2. **`profile/profile-token-storage/lifecycle-manager.ts`** — inline durability gate on `publishAggregatorPointerBestEffort`. HEAD- verifies the just-published snapshot CID against the configured gateways BEFORE clearing `pendingPublishCid`. On gate timeout the publish is classified transient (`IPFS_NOT_YET_DURABLE`), the marker is KEPT for retry, and the flush itself completes (PR #272's at-least-once Nostr ack gate is preserved). Tunable via `ProfileConfig.pointerPublishDurabilityGateMs` (factory default 5000ms; direct-construction default 0). 3. **Read-only token fallback + preserve legacy on migration** (`profile/profile-token-storage-provider.ts`, `core/Sphere.ts`, `profile/migration.ts`). Migration step 5c no longer wipes the legacy IDB token storage; instead it writes a `migration.migratedAt` marker. New `SphereInitOptions.fallbackTokenStorage` / new factory `createBrowserProfileProvidersAuto` auto-detect the marker and wire a legacy `IndexedDBTokenStorageProvider` as the read-only fallback. Consulted at three sites inside Profile `load()`: `no-bundles`, `no-bundles-fetched`, and the outer-catch path. `Sphere.clear()` now wipes the fallback too — prevents token resurrection after a deliberate clear. ## Vendor diff - `vendor-sphere-sdk/SHA.txt`: `8ebba68` → `eea87ca` - `vendor-sphere-sdk/package.json`: version label + new `blockstore-idb: ^4.0.1` dependency entry (transitively required by the new IDBBlockstore install path). - `vendor-sphere-sdk/dist/**`: rebuilt artifacts from sphere-sdk `integration/all-fixes` at `eea87ca`. - `package-lock.json`: regenerated to include `blockstore-idb` and its transitive deps in the consumer (sphere.telco) tree. ## Verified locally - `npm install` — clean, blockstore-idb resolved. - `npm run build` — clean Vite build; `IDBBlockstore` symbol present in the output bundle (confirms tsup's static `import("blockstore-idb")` is statically discovered and bundled by Vite/Rollup end-to-end). - sphere-sdk's own test suite: 8061 passed, 2 skipped, 0 failures at the bumped SHA. ## Why this matters Issue #330 is a critical browser durability bug: a fresh wallet funded then reloaded shows `tokens=0`, with the legacy IndexedDB holding only the nametag token (Profile-mode wallets never wrote back to legacy). The three SDK fixes close all three architectural faults (memory blockstore, publish-before-durable, no fallback); this vendor bump propagates them into the live sphere.telco app on sphere-telco-test.dyndns.org.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Vendor bump from `0.7.5-sdk-8ebba68` → `0.7.5-sdk-eea87ca` to land sphere-sdk PR #331, which resolves issue #330 — browser Profile loses all tokens on reload.
What's in the SDK bump
Four commits on `integration/all-fixes`:
`fbdb24a` fix(profile)(fix(layout)(#329): direct aggregator probe — bypass SDK pinger false-negative #330): install IDBBlockstore for browser Helia. Browser Helia was using its default `MemoryBlockstore` so every OpLog/CAR block evaporated on tab unload. Now installs `IDBBlockstore` (from `blockstore-idb@^4.0.1`) symmetric to the Node-side `FsBlockstore` install. The companion pin-shim (chore(deps): vendor-bump sphere-sdk to 50db1fd (UXF SMT path opaque embed, issue #295) #311) becomes meaningful.
`0efecf0` fix(profile)(fix(layout)(#329): direct aggregator probe — bypass SDK pinger false-negative #330): inline durability gate on pointer publish. `publishAggregatorPointerBestEffort` now HEAD-verifies the just-published snapshot CID against the configured gateways BEFORE clearing `pendingPublishCid`. Closes the gap where the pointer could advertise a CID the operator gateway hadn't yet propagated. Preserves PR pinned groups #272's at-least-once Nostr ack gate. Tunable via `ProfileConfig.pointerPublishDurabilityGateMs` (default 5000ms for the factory).
`04eaf32` fix(profile)(fix(layout)(#329): direct aggregator probe — bypass SDK pinger false-negative #330): read-only token-storage fallback + preserve legacy on migration. Migration step 5c no longer wipes the legacy IDB token storage; instead it writes a `migration.migratedAt` marker. `ProfileTokenStorageProvider.setFallbackTokenStorage()` wires a read-only legacy provider that is consulted at three sites inside `load()`. New `createBrowserProfileProvidersAuto()` async factory auto-detects the marker and constructs the fallback. `Sphere.clear()` wipes it too.
`fcb84af` fix(profile)(fix(layout)(#329): direct aggregator probe — bypass SDK pinger false-negative #330): address code-review findings (3 blockers + 5 bugs). Adversarial review uncovered three merge blockers (the `as string` import cast bypassing bundlers, `Sphere.clear()` not wiping fallback, no auto-wiring of fallback from marker) and five bugs in the gate logic (same-CID double leg in `verifyFlushDurability`, stamp-order before verification, missing `PutFailedError` handling in `isMissError`, missing `lastTokenManifest` reset on fallback returns, double `storage:pending-publish` emit). All addressed.
Vendor diff
Test plan
Migration impact for existing users
Related