557ffe75270b
fix: sync trigger — filter to trustSource:'direct' only; persist peach_last_sync_result after successful sync (v3.6.95)
- time
- 2026-05-22 18:24 UTC · 5 months ago
- machine
- koh2
- parent
- 21d3f786ea14
↓ peach-browser-557ffe75.tar.gzatlas at this save
files changed1 file
src/background/sync-trigger.ts+8 −3src/background/sync-trigger.ts+8 −3
@@ -15,6 +15,7 @@1515 listPairedDevices,1616 markLastSyncedAt,1717 setLastSyncAt,18+ setLastSyncResult,1819 } from "./paired-devices";1920 import type { PairedDevice } from "../shared/sync-types";2021 @@ -83,7 +84,9 @@8384 try {8485 const devices = await listPairedDevices();8586 const hosts = devices.filter(86- (d) => d.deviceType === "android" || d.deviceType === "ios",87+ (d) =>88+ (d.deviceType === "android" || d.deviceType === "ios") &&89+ d.trustSource === "direct",8790 );8891 if (hosts.length === 0) return;8992 if (!runner) return;@@ -126,9 +129,11 @@126129 entriesSent,127130 error: undefined,128131 });129- // Persist so the popup's "last synced" indicator survives a SW restart.130- // Best-effort — a storage failure must not surface as a sync failure.132+ // Persist so the popup's "last synced" indicator and entry counts133+ // survive a SW restart. Best-effort — storage failures must not134+ // surface as sync failures.131135 void setLastSyncAt(now).catch(() => undefined);136+ void setLastSyncResult({ entriesReceived, entriesSent }).catch(() => undefined);132137 } else {133138 setState({134139 status: "error",