Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở
#1,467 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
70/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
rust, typescript
Lĩnh vực
authentication, frontend

Hướng nghiên cứu

Sau khi dfinity/icp-js-auth#137 được phát hành, sử dụng 11 điểm vào vetkeys bị ảnh hưởng được liệt kê và grep để tìm workaround của #120. Nâng cấp @icp-sdk/auth, xóa override LocalStorage/Ed25519 và import không được sử dụng, sau đó xác minh rằng việc đăng nhập trên localhost, tải lại liên tục và các chu kỳ đăng nhập-đăng xuất không còn tạo ra InvalidStateError.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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/[email protected], 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.

Ngôn ngữ chính
Rust
Star
613
Fork
433
Merge trung bình
19 giờ 43 phút
Pull request đã merge (30 ngày)
4

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của dfinity/examples

Tất cả issue của dfinity/examples

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.