From 982cee2982d2246f4ee1f4945f74a71286f77c92 Mon Sep 17 00:00:00 2001 From: Natalie Date: Sun, 31 May 2026 18:36:01 -0600 Subject: [PATCH] =?UTF-8?q?feat(apps):=20=E2=9C=A8=20add=20incremental=20s?= =?UTF-8?q?ync=20overlap=20for=20recent=20messages?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Lilith Autocommit --- @packages/imessage/Sources/IMessageSync/SyncManager.swift | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/@packages/imessage/Sources/IMessageSync/SyncManager.swift b/@packages/imessage/Sources/IMessageSync/SyncManager.swift index 13df109..f19fd51 100644 --- a/@packages/imessage/Sources/IMessageSync/SyncManager.swift +++ b/@packages/imessage/Sources/IMessageSync/SyncManager.swift @@ -46,6 +46,14 @@ final class SyncManager: BaseSyncManager { static let syncSchemaVersion = 3 + /// Overlap lookback for the incremental read. The watermark advances to the + /// newest synced message *date* (see `runReadCycle`), and each cycle re-reads + /// from `watermark − overlap` so messages that land below the watermark — + /// out-of-order delivery, late SMS, or a chat.db→Date timezone/DST skew — are + /// always re-scanned. Server upserts by external_id, so re-scanning is + /// idempotent (no duplicates). This is the fix for silent recent-message drop. + static let incrementalOverlapSeconds: TimeInterval = 2 * 60 * 60 + // Module-specific @Published state (base owns isSyncing/lastSyncCompletedAt/ // currentOperation/syncError/stats). @Published var contactSyncInfo = ContactSyncInfo()