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()