Fix issue where glucose values outside of guardrails could be selected.#527
Merged
Conversation
…d. Also fixes a related crash
Contributor
|
This does "fix" the crash but it also changes the minimum and maximum ranges available in mmol/L.
|
Collaborator
Author
|
Yes, some previous values that appeared to be "acceptable" were actually below/above the guardrail values, due to rounding, causing this crash. As discussed in other tickets, making the guardrails configurable at a build level would be the way to allow the range to be extended. |
…s, but still keeping allowed mgdl/L values intact. And fix helper text to use correct values.
PorkShoulderHolder
pushed a commit
to replicahealth/LoopKit
that referenced
this pull request
Feb 21, 2024
* [LOOP-4681] initial meals main screen UI; tab bar updates
loopkitdev
pushed a commit
to loopkitdev/LoopKit
that referenced
this pull request
Jun 10, 2026
Three tests carried expectations that no longer match the tidepool-synced LoopAlgorithm / LoopQuantity behavior the workspace now pins. None are regressions: - GuardrailTests.testMinCorrectionRangeValue / testPreMealCorrectionRange: expected 86.1 / 66.1, the deliberately-offset constants from LoopKit#527 ("glucose values outside guardrails could be selected"). LoopKit#459 ("Swift package prep") reverted the constants to clean 87 / 67 and moved boundary selectability into GlucoseValuePicker; these two test values were the only leftovers (testCorrectionRange already expects 87). Updated to 87 / 67. - LoopMathTests.testDecayEffect: decayEffect is now a continuous function of the (unaligned) sample timestamp, so the 10:13:20 sample interpolates instead of snapping to the 5-minute grid. (testDecayEffectWithEvenGlucose, aligned to :00, was already passing.) Updated to the continuous values with accuracy comparison. - InsulinMathTests.testAppendedUnionOfPumpEvents: called filterDateRange on intentionally-unsorted pump events; filterDateRange now binary-searches and asserts ascending order. Production already sorts before any filterDateRange (DoseStore.getNormalizedPumpEventDoseEntries does reconciled().sorted), so the test now sorts its input to exercise the same precondition. LoopKitTests: 459 tests, 0 failures.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Also fixes the crash described here: LoopKit/Loop#1864