Skip to content

Commit

Permalink
Remove markScheduledMessagesAsDoneAndDeleteNeverShownMessages
Browse files Browse the repository at this point in the history
  • Loading branch information
ayoy committed Jul 24, 2024
1 parent 211ab02 commit 9bcf1ec
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
1 change: 0 additions & 1 deletion Sources/RemoteMessaging/CoreData/RemoteMessageUtils.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
//
// RemoteMessageUtils.swift
// DuckDuckGo
//
// Copyright © 2024 DuckDuckGo. All rights reserved.
//
Expand Down
12 changes: 4 additions & 8 deletions Sources/RemoteMessaging/RemoteMessagingStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,9 @@ public final class RemoteMessagingStore: RemoteMessagingStoring {
if let remoteMessage = processorResult.message {
addOrUpdate(remoteMessage: remoteMessage, in: context)
} else {
markScheduledMessagesAsDoneAndDeleteNeverShownMessages(in: context)
markScheduledMessagesAsDone(in: context)
}
deleteNotShownDoneMessages(in: context)

do {
try context.save()
Expand All @@ -111,7 +112,8 @@ public final class RemoteMessagingStore: RemoteMessagingStoring {

context.performAndWait {
invalidateRemoteMessagingConfigs(in: context)
markScheduledMessagesAsDoneAndDeleteNeverShownMessages(in: context)
markScheduledMessagesAsDone(in: context)
deleteNotShownDoneMessages(in: context)

do {
try context.save()
Expand Down Expand Up @@ -417,12 +419,6 @@ extension RemoteMessagingStore {
remoteMessageManagedObject.shown = false
}
}
deleteNotShownDoneMessages(in: context)
}

private func markScheduledMessagesAsDoneAndDeleteNeverShownMessages(in context: NSManagedObjectContext) {
markScheduledMessagesAsDone(in: context)
deleteNotShownDoneMessages(in: context)
}

private func updateRemoteMessage(withID id: String, toStatus status: RemoteMessageStatus, in context: NSManagedObjectContext) {
Expand Down

0 comments on commit 9bcf1ec

Please sign in to comment.