From c583c4d474d7770c12422756a56ccfe5c41aba8a Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Mon, 6 Jan 2020 18:18:27 -0800 Subject: [PATCH] Fetch both read and unread orphaned statuses. --- Frameworks/ArticlesDatabase/StatusesTable.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Frameworks/ArticlesDatabase/StatusesTable.swift b/Frameworks/ArticlesDatabase/StatusesTable.swift index a9e67d5eb..04916d3de 100644 --- a/Frameworks/ArticlesDatabase/StatusesTable.swift +++ b/Frameworks/ArticlesDatabase/StatusesTable.swift @@ -108,7 +108,7 @@ final class StatusesTable: DatabaseTable { var articleIDs = Set() func makeDatabaseCall(_ database: FMDatabase) { - let sql = "select articleID from statuses s where ((starred=1) || (read=0 and dateArrived > ?)) and userDeleted=0 and not exists (select 1 from articles a where a.articleID = s.articleID);" + let sql = "select articleID from statuses s where (starred=1 or dateArrived>?) and userDeleted=0 and not exists (select 1 from articles a where a.articleID = s.articleID);" if let resultSet = database.executeQuery(sql, withArgumentsIn: [cutoffDate]) { articleIDs = resultSet.mapToSet(self.articleIDWithRow) }