From ac1e5e66be3cbcae74ce4558aabc2130bed50b24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sat, 26 Sep 2026 10:20:32 +0200 Subject: [PATCH] Remove assertion about SQLite snapshot ordering Fix #1883 --- .../Observers/ValueConcurrentObserver.swift | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/GRDB/ValueObservation/Observers/ValueConcurrentObserver.swift b/GRDB/ValueObservation/Observers/ValueConcurrentObserver.swift index 5c3d6f486..1f87b24cb 100644 --- a/GRDB/ValueObservation/Observers/ValueConcurrentObserver.swift +++ b/GRDB/ValueObservation/Observers/ValueConcurrentObserver.swift @@ -452,8 +452,15 @@ extension ValueConcurrentObserver { let isModified: Bool if let currentWALSnapshot = try? WALSnapshot(writerDB) { let ordering = initialFetchTransaction.walSnapshot.compare(currentWALSnapshot) - assert(ordering <= 0, "Unexpected snapshot ordering") - isModified = ordering < 0 + // We expect `ordering <= 0`, since the current + // snapshot is captured after the snapshot of the + // initial fetch. The current one is supposed to be + // identical (no change), or newer (database was + // changed since initial fetch). Yet SQLite has + // a quirk, as revealed by + // That's why we just check for a difference, and do + // not `assert(ordering <= 0)`. + isModified = ordering != 0 } else { // Can't compare: assume the database was modified. isModified = true