Browse Source

Add precision to glucose-get-last.js for testing JS

This PR adds precision to the glucose-get-last.js code that we use in
the testing bundle to replay OrefSwift inputs. It also includes a
small update to make timezone changing more reliable.

The added precision fixes a small inconsistency we saw in
production. We tested the updated code against our full
`determineBasal` database of inputs to confirm that the existing
inputs remain consistent.
Sam King 3 tháng trước cách đây
mục cha
commit
cc596f1925

+ 12 - 0
Trio/Resources/InfoPlist.xcstrings

@@ -457,6 +457,18 @@
         }
       }
     },
+    "NSCalendarsFullAccessUsageDescription" : {
+      "comment" : "Privacy - Calendars Full Access Usage Description",
+      "extractionState" : "extracted_with_value",
+      "localizations" : {
+        "en" : {
+          "stringUnit" : {
+            "state" : "new",
+            "value" : "To create events with BG reading values, so that they can be viewed on Apple Watch and CarPlay"
+          }
+        }
+      }
+    },
     "NSCalendarsUsageDescription" : {
       "comment" : "Privacy - Calendars Usage Description",
       "extractionState" : "extracted_with_value",

+ 0 - 1
Trio/Sources/Localizations/Main/Localizable.xcstrings

@@ -10037,7 +10037,6 @@
       }
     },
     "%lld h" : {
-      "extractionState" : "stale",
       "localizations" : {
         "bg" : {
           "stringUnit" : {

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 1
TrioTests/OpenAPSSwiftTests/javascript/bundle/glucose-get-last.js


+ 2 - 0
TrioTests/OpenAPSSwiftTests/utils/TimeZoneForTests.swift

@@ -9,6 +9,7 @@ class TimeZoneForTests {
         // Set environment variable
         setenv("TZ", identifier, 1)
         tzset() // Make the change take effect
+        CFTimeZoneResetSystem()
 
         // Force update the default TimeZone
         // This is the critical missing piece
@@ -31,6 +32,7 @@ class TimeZoneForTests {
             unsetenv("TZ")
         }
         tzset()
+        CFTimeZoneResetSystem()
 
         // Restore original default TimeZone
         if let originalTimeZone = originalDefaultTimeZone {