From f251896198b2b35279ae6cf8297f8534310a6e99 Mon Sep 17 00:00:00 2001 From: Justin Mazzocchi <2831158+jzzocc@users.noreply.github.com> Date: Thu, 5 May 2022 19:31:57 -0700 Subject: [PATCH] Order notifications by createdAt instead of id --- DB/Sources/DB/Content/ContentDatabase.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DB/Sources/DB/Content/ContentDatabase.swift b/DB/Sources/DB/Content/ContentDatabase.swift index 5ca2372..223949b 100644 --- a/DB/Sources/DB/Content/ContentDatabase.swift +++ b/DB/Sources/DB/Content/ContentDatabase.swift @@ -564,7 +564,7 @@ public extension ContentDatabase { excludeTypes: Set) -> AnyPublisher<[CollectionSection], Error> { ValueObservation.tracking( NotificationInfo.request( - NotificationRecord.order(NotificationRecord.Columns.id.desc) + NotificationRecord.order(NotificationRecord.Columns.createdAt.desc) .filter(!excludeTypes.map(\.rawValue).contains(NotificationRecord.Columns.type))).fetchAll) .removeDuplicates() .publisher(in: databaseWriter)