7d40cd620602

convert recovery-words dynamic imports to static in vault.ts and messages.ts — SW has no document for vite preload helper (v2.33.7)

time
2026-05-07 01:20 UTC · 5 months ago
machine
koh2
parent
e774d43ad6de
4 files manifest.firefox.json+1 −1manifest.json+1 −1src/background/messages.ts+1 −1src/background/vault.ts+5 −6
manifest.firefox.json+1 −1
@@ -1,7 +1,7 @@11 {22   "manifest_version": 3,33   "name": "Peach",4-  "version": "2.33.6",4+  "version": "2.33.7",55   "description": "Zero-knowledge password manager",66   "browser_specific_settings": {77     "gecko": {

view file

manifest.json+1 −1
@@ -1,7 +1,7 @@11 {22   "manifest_version": 3,33   "name": "Peach",4-  "version": "2.33.6",4+  "version": "2.33.7",55   "description": "Zero-knowledge password manager",66   "action": {77     "default_popup": "src/popup/index.html",

view file

src/background/messages.ts+1 −1
@@ -37,6 +37,7 @@3737 } from "./passkey";3838 import { buildAdvancedHealthReport, resolveResetUrl } from "./health";3939 import { storageClear } from "../shared/storage";40+import { findInvalidWords } from "../shared/recovery-words";4041 import type {4142   Message,4243   MessageResponse,@@ -193,7 +194,6 @@193194       }194195       case "VALIDATE_RECOVERY_WORDS": {195196         const { words } = msg.payload as { words: string[] };196-        const { findInvalidWords } = await import("../shared/recovery-words");197197         const invalid = findInvalidWords(words);198198         return { ok: true, data: { valid: invalid.length === 0, invalid } };199199       }

view file

src/background/vault.ts+5 −6
@@ -11,6 +11,11 @@1111 1212 import { deriveKey, generateSalt } from "../crypto/argon2";1313 import { extractDomain } from "../shared/domain";14+import {15+  rootKeyToWords,16+  wordsToRootKeyMaterial,17+  deriveRecoveryKey,18+} from "../shared/recovery-words";1419 import type {1520   AccentColorName,1621   LegacyVaultEntry,@@ -228,8 +233,6 @@228233   const rootKeyBytes = crypto.getRandomValues(new Uint8Array(32));229234 230235   // Derive the recovery key from the BIP39 words encoding of the root key.231-  const { rootKeyToWords, wordsToRootKeyMaterial, deriveRecoveryKey } =232-    await import("../shared/recovery-words");233236   const words = await rootKeyToWords(rootKeyBytes);234237   const wordMaterial = await wordsToRootKeyMaterial(words);235238   const recoverySalt = crypto.getRandomValues(new Uint8Array(16));@@ -275,9 +278,6 @@275278   recoverySaltHex: string,276279   words: string[]277280 ): Promise<void> {278-  const { wordsToRootKeyMaterial, deriveRecoveryKey } = await import(279-    "../shared/recovery-words"280-  );281281   const wordMaterial = await wordsToRootKeyMaterial(words);282282   const recoverySalt = unhex(recoverySaltHex);283283   const recoveryKey = await deriveRecoveryKey(wordMaterial, recoverySalt);@@ -443,7 +443,6 @@443443   if (!rootKey) {444444     throw new Error("recovery not set up — vault may need migration");445445   }446-  const { rootKeyToWords } = await import("../shared/recovery-words");447446   return rootKeyToWords(rootKey);448447 }449448 

view file