Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update submodule CGMBLEKit: no change in function #330

Merged

Conversation

marionbarker
Copy link
Contributor

Summary:

update submodule CGMBLEKit: no change in function, add log to filter future events

Details:

Previously, Trio pointed to the SHA from loopandlearn dev_rc branch; this branch comprised LoopKit version plus code found in three PR open at that time to LoopKit/CGMBLEKit.

Subsequent to the dev_rc branch creation, a modification was requested to LoopKit CGMBLEKit PR 191; which was implemented. And 2 of the 3 PR were merged into dev over at LoopKit.

After the merge of #303, we created a new trio branch for loopandlearn/CGMBLEKit based off of LoopKit/CGMBLEKit dev branch. So the trio branch has the modified code for PR 191 (added logging of any future events before they are filtered out). And then the trio branch was modified to include the cherry-pick from the one PR (192) still open over at LoopKit.

So the function of this code is identical except for the added logging.

git index details:

Trio % git diff alpha update_CGMBLEKit_submodule
diff --git a/CGMBLEKit b/CGMBLEKit
index a92e9752..15af9cf3 160000
--- a/CGMBLEKit
+++ b/CGMBLEKit
@@ -1 +1 @@
-Subproject commit a92e9752994e7b143cdb007d3c7bcba0c0cc9214
+Subproject commit 15af9cf319bff2ac49c361da254ad667461d4687

Logging change in CGMBLEKit:

CGMBLEKit % git diff a92e9752 15af9cf31
diff --git a/CGMBLEKit/TransmitterManager.swift b/CGMBLEKit/TransmitterManager.swift
index cdff276..9500060 100644
--- a/CGMBLEKit/TransmitterManager.swift
+++ b/CGMBLEKit/TransmitterManager.swift
@@ -336,10 +336,15 @@ public class TransmitterManager: TransmitterDelegate {
         }
 
         // Filter out future-dated events
+        // Stopgap measure for the issue described in https://github.com/LoopKit/Loop/issues/2087
         events = events.filter { event in
-            return event.date <= Date() // Ensure event date is not in the future
+            if event.date > Date() {
+                log.error("Future-dated event detected: %{public}@", String(describing: event))
+                return false
+            }
+            return true
         }
-        
+
         if !events.isEmpty {
             shareManager.delegate.notify { delegate in
                 delegate?.cgmManager(self.shareManager, hasNew: events)

@Sjoerd-Bo3 Sjoerd-Bo3 merged commit 3ec6176 into nightscout:alpha Jun 23, 2024
This was referenced Jun 25, 2024
@marionbarker marionbarker deleted the update_CGMBLEKit_submodule branch July 21, 2024 03:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants