Skip to content

Commit

Permalink
fix(NotificationService): Refresh realm after fetching messages
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippeWeidmann committed Apr 21, 2023
1 parent 35bed6f commit 40aabe6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion MailNotificationServiceExtension/NotificationService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ class NotificationService: UNNotificationServiceExtension {
}
try await mailboxManager.threads(folder: inboxFolder.freezeIfNeeded())

@ThreadSafe var message = mailboxManager.getRealm().object(ofType: Message.self, forPrimaryKey: uid)
let realm = mailboxManager.getRealm()
realm.refresh()
@ThreadSafe var message = realm.object(ofType: Message.self, forPrimaryKey: uid)

if let message,
!message.fullyDownloaded {
Expand Down

0 comments on commit 40aabe6

Please sign in to comment.