vetkeys: remove #120 IdbStorage/LocalStorage workaround once icp-js-auth#137 is released
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 613
- Forks
- 434
- Avg merge
- 8h 28m
- Merged PRs (30d)
- 9
Description
Background
The vetkeys examples currently carry a localhost-only workaround for dfinity/icp-js-auth#120: on localhost they swap the default secure IdbStorage + ECDSA key for LocalStorage + Ed25519, because the default IdbStorage threw InvalidStateError: ... The database connection is closing on Vite dev servers.
The upstream fix is dfinity/icp-js-auth#137 (recovers from force-closed IndexedDB connections + memoizes the storage connection + awaits session hydration before signIn/signOut writes). It has been verified to resolve #120 (bug reproduces on @icp-sdk/auth@8.0.3, gone on the PR branch).
Task
Once #137 is merged and released, in each affected example:
- Bump
@icp-sdk/authto the release that contains the fix. - Remove the
#120workaround — drop theisLocalEnv ? { storage: new LocalStorage(), keyType: "Ed25519" } : {}override (and the now-unusedLocalStorageimport) so localhost uses the default secureIdbStorage+ ECDSA, same as production.
Affected examples (11)
Files containing the workaround (grep -rl "icp-js-auth/issues/120"):
motoko/vetkeys/basic_bls_signing/frontend/src/main.tsmotoko/vetkeys/basic_ibe/frontend/src/main.tsmotoko/vetkeys/encrypted_notes_app_vetkd/frontend/src/store/auth.tsmotoko/vetkeys/password_manager/frontend/src/store/auth.tsmotoko/vetkeys/password_manager_with_metadata/frontend/src/store/auth.tsrust/vetkeys/basic_bls_signing/frontend/src/main.tsrust/vetkeys/basic_ibe/frontend/src/main.tsrust/vetkeys/basic_timelock_ibe/frontend/src/main.tsrust/vetkeys/encrypted_notes_app_vetkd/frontend/src/store/auth.tsrust/vetkeys/password_manager/frontend/src/store/auth.tsrust/vetkeys/password_manager_with_metadata/frontend/src/store/auth.ts
(basic_vetkd motoko + rust don't carry the workaround.)
Verify after removal
Log in on a localhost dev server, then exercise reload churn / login-logout cycles — the InvalidStateError must no longer appear, confirming the default IdbStorage path is safe again.
Blocked on dfinity/icp-js-auth#137.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
After dfinity/icp-js-auth#137 is released, use the listed 11 affected vetkeys entry points and grep for the #120 workaround. Bump @icp-sdk/auth, remove the LocalStorage/Ed25519 override and unused import, then verify localhost login, reload churn, and login-logout cycles no longer produce InvalidStateError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust, typescript
- Domain
- authentication, frontend
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 70/100