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/auth to the release that contains the fix.
- Remove the
#120 workaround — drop the isLocalEnv ? { storage: new LocalStorage(), keyType: "Ed25519" } : {} override (and the now-unused LocalStorage import) so localhost uses the default secure IdbStorage + 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.ts
motoko/vetkeys/basic_ibe/frontend/src/main.ts
motoko/vetkeys/encrypted_notes_app_vetkd/frontend/src/store/auth.ts
motoko/vetkeys/password_manager/frontend/src/store/auth.ts
motoko/vetkeys/password_manager_with_metadata/frontend/src/store/auth.ts
rust/vetkeys/basic_bls_signing/frontend/src/main.ts
rust/vetkeys/basic_ibe/frontend/src/main.ts
rust/vetkeys/basic_timelock_ibe/frontend/src/main.ts
rust/vetkeys/encrypted_notes_app_vetkd/frontend/src/store/auth.ts
rust/vetkeys/password_manager/frontend/src/store/auth.ts
rust/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.
Background
The vetkeys examples currently carry a localhost-only workaround for dfinity/icp-js-auth#120: on
localhostthey swap the default secureIdbStorage+ ECDSA key forLocalStorage+Ed25519, because the defaultIdbStoragethrewInvalidStateError: ... The database connection is closingon 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/signOutwrites). 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:
@icp-sdk/authto the release that contains the fix.#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_vetkdmotoko + rust don't carry the workaround.)Verify after removal
Log in on a
localhostdev server, then exercise reload churn / login-logout cycles — theInvalidStateErrormust no longer appear, confirming the defaultIdbStoragepath is safe again.Blocked on dfinity/icp-js-auth#137.