فهرست منبع

Fix spurious 'Bolus failed' notification after manual bolus

The post-bolus determineBasalSync() call was inside the bolus do/catch,
so any algorithm error (e.g. 'Not enough glucose data' during CGM warm-up)
was misreported as a bolus failure even though the pump had already
delivered the bolus successfully. Wrap the algorithm refresh in its own
do/catch so it cannot trigger bolusDidFail or a pumpError notification.
Robert 2 هفته پیش
والد
کامیت
e51fc67ee0
1فایلهای تغییر یافته به همراه10 افزوده شده و 3 حذف شده
  1. 10 3
      Trio/Sources/APS/APSManager.swift

+ 10 - 3
Trio/Sources/APS/APSManager.swift

@@ -583,11 +583,18 @@ final class BaseAPSManager: APSManager, Injectable {
         do {
             try await pump.enactBolus(units: roundedAmount, automatic: isSMB)
             debug(.apsManager, "Bolus succeeded")
-            if !isSMB {
-                try await determineBasalSync()
-            }
             bolusProgress.send(0)
             callback?(true, String(localized: "Bolus enacted successfully.", comment: "Success message for enacting a bolus"))
+            if !isSMB {
+                do {
+                    try await determineBasalSync()
+                } catch {
+                    warning(
+                        .apsManager,
+                        "determineBasalSync after manual bolus failed: \(error.localizedDescription)"
+                    )
+                }
+            }
         } catch {
             warning(.apsManager, "Bolus failed with error: \(error)")
             processError(APSError.pumpError(error))