     func updateDeliveredNotifications(resourceRepository: ResourceRepositoryReader, completionHandler: @escaping (Bool) -> Void) {
         let center = UNUserNotificationCenter.current()
         center.getDeliveredNotifications { delivered in
-            guard delivered.contains(where: { $0.request.identifier == NotificationManagerIdentifier.text.description }) else {
+            guard let notification = delivered.first(where: { $0.request.identifier == NotificationManagerIdentifier.text.description }) else {
                 os_log("No delivered notifications present", type: .debug)
                 completionHandler(false)
                 return
             }
             
             do {
-                let didScheduleNotification = try self.scheduleNotificationForNextReviewCount(resourceRepository: resourceRepository)
+                let didScheduleNotification = try self.scheduleNotificationForNextReviewCount(resourceRepository: resourceRepository, deliveredNotification: notification)
                 completionHandler(didScheduleNotification)
             } catch {
                 os_log("Failed to refresh delivered notification text: %@", type: .error, error as NSError)

        }
    }
    
    private func scheduleNotificationForNextReviewCount(resourceRepository: ResourceRepositoryReader) throws -> Bool {
        guard try resourceRepository.hasReviewTimeline() else {
            return false
        }

        scheduleNotification(content: content, identifier: .text, at: date)
    }
    
    private func scheduleNotification(content: UNNotificationContent, identifier: NotificationManagerIdentifier, at date: Date?) {
        let trigger = date.map({ d -> UNNotificationTrigger in
            let dateComponents = Calendar.current.dateComponents([.era, .year, .month, .day, .hour, .minute, .second], from: d)
            return UNCalendarNotificationTrigger(dateMatching: dateComponents, repeats: false)
        })
        
        let request = UNNotificationRequest(identifier: identifier.description, content: content, trigger: trigger)
        let center = UNUserNotificationCenter.current()
