From a5d6e5403e8f44b61dda78bebe8abb4c7d232a52 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Mon, 20 May 2019 13:55:26 -0500 Subject: [PATCH] Add additional sql check to ensure we don't pick up deleted articles when querying for missing articles --- 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 86b29034e..2edf4ad6a 100644 --- a/Frameworks/ArticlesDatabase/StatusesTable.swift +++ b/Frameworks/ArticlesDatabase/StatusesTable.swift @@ -87,7 +87,7 @@ final class StatusesTable: DatabaseTable { } func fetchArticleIDsForStatusesWithoutArticles() -> Set { - return fetchArticleIDs("select articleID from statuses s where userDeleted=0 and not exists (select 1 from articles a where a.articleID = s.articleID);") + return fetchArticleIDs("select articleID from statuses s where (read=0 or starred=1) and userDeleted=0 and not exists (select 1 from articles a where a.articleID = s.articleID);") } func fetchArticleIDs(_ sql: String) -> Set {