Avoid race and duplication conditions between local and remote notifications (#848)

* added timestamp control of the local notification

* improved the code, and implemented the solution, just needs some testing

* sdk bump

* UserPreference init with initialValue instead of defaultValue

* pr suggestions

* changelog

* notifications sliding sync view added
This commit is contained in:
Mauro
2023-05-03 16:28:07 +02:00
committed by GitHub
parent 60c2692a26
commit 95492d7e10
15 changed files with 251 additions and 108 deletions
@@ -23,6 +23,8 @@ protocol TimelineEventProxyProtocol {
var eventID: String { get }
var senderID: String { get }
var timestamp: Date { get }
}
final class TimelineEventProxy: TimelineEventProxyProtocol {
@@ -43,10 +45,15 @@ final class TimelineEventProxy: TimelineEventProxyProtocol {
var type: TimelineEventType? {
try? timelineEvent.eventType()
}
var timestamp: Date {
Date(timeIntervalSince1970: TimeInterval(timelineEvent.timestamp() / 1000))
}
}
struct MockTimelineEventProxy: TimelineEventProxyProtocol {
let eventID: String
let senderID = ""
let type: TimelineEventType? = nil
let timestamp = Date()
}