diff --git a/Modules/SyncDatabase/Sources/SyncDatabase/SyncStatusTable.swift b/Modules/SyncDatabase/Sources/SyncDatabase/SyncStatusTable.swift index 86655a1d3..05eba1b3e 100644 --- a/Modules/SyncDatabase/Sources/SyncDatabase/SyncStatusTable.swift +++ b/Modules/SyncDatabase/Sources/SyncDatabase/SyncStatusTable.swift @@ -124,8 +124,11 @@ private extension SyncStatusTable { return SyncStatus(articleID: articleID, key: key, flag: flag, selected: selected) } + // Includes rows that are selected — a send in flight hasn’t been confirmed by the server yet, + // and skipping those let a concurrent refresh revert the change the send was carrying. + // static func selectPendingArticleIDs(_ statusKey: ArticleStatus.Key, database: FMDatabase) -> Set? { - let sql = "select articleID from \(name) where selected == false and key = \"\(statusKey.rawValue)\";" + let sql = "select articleID from \(name) where key = \"\(statusKey.rawValue)\";" guard let resultSet = database.executeQuery(sql, withArgumentsIn: nil) else { return nil }