Explorar o código

Address PR feedback by @AndreasStokholm, added descriptive logging

Deniz Cengiz hai 1 ano
pai
achega
6fb0bfe3c7

+ 4 - 4
FreeAPS/Sources/APS/Storage/CarbsStorage.swift

@@ -467,12 +467,12 @@ final class BaseCarbsStorage: CarbsStorage, Injectable {
                     createdAt: result.date ?? Date(),
                     actualDate: result.date,
                     carbs: Decimal(result.carbs),
-                    fat: Decimal(result.fat),
-                    protein: Decimal(result.protein),
+                    fat: nil,
+                    protein: nil,
                     note: result.note,
                     enteredBy: CarbsEntry.manual,
-                    isFPU: result.isFPU,
-                    fpuID: result.fpuID?.uuidString
+                    isFPU: nil,
+                    fpuID: nil,
                 )
             }
         }

+ 3 - 4
FreeAPS/Sources/Modules/DataTable/DataTableStateModel.swift

@@ -79,11 +79,11 @@ extension DataTable {
                     }
 
                     debugPrint(
-                        "\(#file) \(#function) \(DebuggingIdentifiers.succeeded) deleted glucose from Apple Health/Nightscout"
+                        "\(#file) \(#function) \(DebuggingIdentifiers.succeeded) deleted glucose from remote service(s) (Nightscout, Apple Health, Tidepool)"
                     )
                 } catch {
                     debugPrint(
-                        "\(#file) \(#function) \(DebuggingIdentifiers.failed) error while deleting glucose from Apple Health/Nightscout with error: \(error.localizedDescription)"
+                        "\(#file) \(#function) \(DebuggingIdentifiers.failed) error while deleting glucose remote service(s) (Nightscout, Apple Health, Tidepool) with error: \(error.localizedDescription)"
                     )
                 }
             }
@@ -165,7 +165,7 @@ extension DataTable {
 
                 } catch {
                     debugPrint(
-                        "\(DebuggingIdentifiers.failed) Error deleting carb entry from Apple Health/Nightscout with error: \(error.localizedDescription)"
+                        "\(DebuggingIdentifiers.failed) Error deleting carb entry from remote service(s) (Nightscout, Apple Health, Tidepool) with error: \(error.localizedDescription)"
                     )
                 }
             }
@@ -221,7 +221,6 @@ extension DataTable {
                         return
                     }
 
-                    // Delete Insulin from Nightscout and Apple Health
                     if let id = treatmentToDelete.id, let timestamp = treatmentToDelete.timestamp,
                        let bolus = treatmentToDelete.bolus, let bolusAmount = bolus.amount
                     {