Просмотр исходного кода

Use the events own timestamp to dedup in PumpHistoryStorage

Marvin Polscheit 3 дней назад
Родитель
Сommit
7ab520cc3a
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      Trio/Sources/APS/Storage/PumpHistoryStorage.swift

+ 2 - 2
Trio/Sources/APS/Storage/PumpHistoryStorage.swift

@@ -101,8 +101,8 @@ final class BasePumpHistoryStorage: PumpHistoryStorage, Injectable {
                         dose.unitsInDeliverableIncrements,
                         toIncrement: Double(self.settings.preferences.bolusIncrement)
                     )
-                    // restrict entry to now or past
-                    let timestamp = event.date > Date() ? Date() : event.date
+                    // Use the event's own timestamp to dedup
+                    let timestamp = event.date
                     let key = dedupKey(timestamp: timestamp, type: PumpEvent.bolus.rawValue)
 
                     if let existingEvent = existingByKey[key] {