5b4ed4f90c88

preserve TOTP parameters in entry patches with regression coverage

time
2026-09-05 03:11 UTC · 1 month ago
machine
koh2
agent
claude-opus-5
session
PB-26-402 TOTP patch
parent
6a896488d3f2
5 files manifest.firefox.json+1 −1manifest.json+1 −1package.json+1 −1src/background/vault.ts+12 −0src/background/vault.update-entry-sanitize.test.ts+25 −0
manifest.firefox.json+1 −1
@@ -1,7 +1,7 @@11 {22   "manifest_version": 3,33   "name": "Peach Password Manager",4-  "version": "5.0.100",4+  "version": "5.0.101",55   "description": "Zero-knowledge password manager",66   "browser_specific_settings": {77     "gecko": {

view file

manifest.json+1 −1
@@ -2,7 +2,7 @@22   "manifest_version": 3,33   "minimum_chrome_version": "116",44   "name": "Peach Password Manager",5-  "version": "5.0.100",5+  "version": "5.0.101",66   "description": "Zero-knowledge password manager",77   "action": {88     "default_popup": "src/popup/index.html",

view file

package.json+1 −1
@@ -1,6 +1,6 @@11 {22   "name": "peach",3-  "version": "5.0.100",3+  "version": "5.0.101",44   "description": "Zero-knowledge password manager",55   "license": "GPL-3.0-only",66   "type": "module",

view file

src/background/vault.ts+12 −0
@@ -2912,6 +2912,18 @@29122912     nextPatch.totp = patch.totp?.trim() || undefined;29132913   }29142914 2915+  if ("totpAlgorithm" in patch) {2916+    nextPatch.totpAlgorithm = patch.totpAlgorithm;2917+  }2918+2919+  if ("totpDigits" in patch) {2920+    nextPatch.totpDigits = patch.totpDigits;2921+  }2922+2923+  if ("totpPeriod" in patch) {2924+    nextPatch.totpPeriod = patch.totpPeriod;2925+  }2926+29152927   if ("notes" in patch) {29162928     nextPatch.notes = patch.notes?.trim() || undefined;29172929   }

view file

src/background/vault.update-entry-sanitize.test.ts+25 −0
@@ -84,6 +84,31 @@8484     createdAt: 1_700_000_000_000,8585   };8686 87+  it("preserves TOTP parameters through an UPDATE_ENTRY patch", async () => {88+    const { vault, entry } = await vaultWithEntry({89+      type: "login",90+      totp: "JBSWY3DPEHPK3PXP",91+      totpAlgorithm: "SHA256",92+      totpDigits: 8,93+      totpPeriod: 60,94+    });95+96+    await vault.updateEntry(entry.id, {97+      title: "Updated",98+      totpAlgorithm: "SHA512",99+      totpDigits: 6,100+      totpPeriod: 45,101+    });102+103+    expect(vault.getEntries().find((e) => e.id === entry.id)).toMatchObject({104+      title: "Updated",105+      totp: "JBSWY3DPEHPK3PXP",106+      totpAlgorithm: "SHA512",107+      totpDigits: 6,108+      totpPeriod: 45,109+    });110+  });111+87112   it("strips a non-https canary webhook from an UPDATE_ENTRY patch", async () => {88113     const { vault, entry } = await vaultWithEntry();89114 

view file