feat(apps): add incremental sync overlap for recent messages

Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
Natalie 2026-05-31 18:36:01 -06:00
parent 0bffc51524
commit 982cee2982

View file

@ -46,6 +46,14 @@ final class SyncManager: BaseSyncManager<SyncStats, SyncError> {
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.dbDate 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()