Skip to content

vetkeys: remove #120 IdbStorage/LocalStorage workaround once icp-js-auth#137 is released #1467

Description

@marc0olo

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:

  1. Bump @icp-sdk/auth to the release that contains the fix.
  2. 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions