e073840d9292

fix: normalizeEntry drops email + additionalUrls on vault read — add both fields to base object, add lock/unlock round-trip tests (v3.6.79)

time
2026-05-21 15:41 UTC · 5 months ago
machine
koh2
parent
95a4903d1acf
5 files manifest.firefox.json+1 −1manifest.json+1 −1package.json+1 −1src/background/vault.test.ts+44 −0src/background/vault.ts+5 −0
manifest.firefox.json+1 −1
@@ -2,7 +2,7 @@22   "_comment_audio_capture": "Firefox does not honor the Chrome 'audioCapture' optional_permission — getUserMedia in WebExtensions is gated solely by the runtime permission prompt. Microphone access for chirp pairing works from the popup under the existing '<all_urls>' host permission; no manifest entry is required or accepted here.",33   "manifest_version": 3,44   "name": "Peach",5-  "version": "3.6.78",5+  "version": "3.6.79",66   "description": "Zero-knowledge password manager",77   "browser_specific_settings": {88     "gecko": {

view file

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

view file

package.json+1 −1
@@ -1,6 +1,6 @@11 {22   "name": "peach",3-  "version": "3.6.76",3+  "version": "3.6.79",44   "description": "Zero-knowledge password manager",55   "type": "module",66   "scripts": {

view file

src/background/vault.test.ts+44 −0
@@ -858,4 +858,48 @@858858     await vault.updateEntry(entry.id, { additionalUrls: ["", "   "] });859859     expect(vault.getEntryById(entry.id)?.additionalUrls).toBeUndefined();860860   });861+862+  it("preserves email field through lock/unlock cycle", async () => {863+    const vault = await import("./vault");864+    await vault.createVault("preserve-email-pass-12345");865+    await vault.addEntry({866+      type: "login",867+      title: "GitHub",868+      username: "june",869+      email: "[email protected]",870+      password: "secret",871+      url: "https://github.com",872+    });873+    vault.lock();874+875+    const ok = await vault.unlock("preserve-email-pass-12345");876+    expect(ok).toBe(true);877+    const entry = vault.getEntries().find((e) => e.title === "GitHub");878+    expect(entry?.email).toBe("[email protected]");879+  });880+881+  it("preserves additionalUrls through lock/unlock cycle", async () => {882+    const vault = await import("./vault");883+    await vault.createVault("preserve-urls-pass-12345");884+    await vault.addEntry({885+      type: "login",886+      title: "Example",887+      username: "june",888+      password: "secret",889+      url: "https://example.com",890+      additionalUrls: [891+        "https://beta.example.com",892+        "https://staging.example.com",893+      ],894+    });895+    vault.lock();896+897+    const ok = await vault.unlock("preserve-urls-pass-12345");898+    expect(ok).toBe(true);899+    const entry = vault.getEntries().find((e) => e.title === "Example");900+    expect(entry?.additionalUrls).toEqual([901+      "https://beta.example.com",902+      "https://staging.example.com",903+    ]);904+  });861905 });

view file

src/background/vault.ts+5 −0
@@ -1939,8 +1939,13 @@19391939     type: "type" in entry ? entry.type : "login",19401940     title: entry.title,19411941     username: entry.username,1942+    email: "email" in entry ? entry.email : undefined,19421943     password: entry.password,19431944     url: entry.url,1945+    additionalUrls:1946+      "additionalUrls" in entry && Array.isArray(entry.additionalUrls)1947+        ? entry.additionalUrls1948+        : undefined,19441949     totp: entry.totp,19451950     notes: entry.notes,19461951     breach: entry.breach,

view file