fix: Prevent app crash while moving presets#540
Merged
Conversation
Contributor
Author
|
Ping @ps2 & @marionbarker |
Contributor
StatusSuccess Test
|
dnzxy
pushed a commit
to dnzxy/LoopKit
that referenced
this pull request
Oct 1, 2024
* fixing the dismissable view * remove unneeded text
loopkitdev
pushed a commit
to loopkitdev/LoopKit
that referenced
this pull request
Mar 12, 2026
Resolved 16 conflicts across 15 files + project.pbxproj: Kept DIY (protect inline algorithm / active UI): - LoopKit/LoopAlgorithm/LoopAlgorithm.swift: kept (DIY inline; fix: correct < vs > in precondition msg) - LoopKit/LoopAlgorithm/LoopPredictionOutput.swift: kept (DIY inline; fix: wrong CodingKey for predictedGlucose) - LoopKit/InsulinKit/ExponentialInsulinModel.swift: kept (DIY inline; fix: missing closing paren in debugDescription) - LoopKitUI/View Controllers/OverrideSelectionViewController.swift: kept (DIY Loop still depends on it; crash fix LoopKit#540) Took Tidepool's: - LoopKitUI/Views/GlucoseValuePicker.swift: selectableValues now caller-provided (cleaner API) - LoopKitUI/Extensions/QuantityFormatter+Guardrails.swift: HKQuantity → LoopQuantity - LoopKitTests/AlertTests.swift: specific JSON encoding assertions - LoopKitTests/GuardrailTests.swift: LoopQuantity, new maxSuspendThreshold API - LoopKitTests/DoseStoreTests.swift: async DoseStore init, new API - LoopKit/InsulinKit/DoseStore.swift: improved async addPumpEvents logging - .circleci/config.yml: Xcode 26.1.1, iPhone 17 destination Manual merges (best of both): - LoopKit/Extensions/Guardrail+Settings.swift: LoopQuantity types + Tidepool's cleaner bounds - LoopKit/QuantityFormatter.swift: LoopUnit (Tidepool) + DIY's rule: parameter preserved - LoopKitUI/Views/Information Screens/GlucoseTherapySettingInformationView.swift: Tidepool's LoopQuantity API + preserved DIY's workoutCorrectionRangeOverride case - MockKitUI/Views/MockCGMManagerSettingsView.swift: kept both heartbeatSubSection (Tidepool) and settingsSubSection (DIY debug features) - LoopKit.xcodeproj/project.pbxproj: merged all file refs from both sides; deployment target 15.1 → 17.0 (Tidepool); preserved LOCALIZATION_PREFERS_STRING_CATALOGS See sync-docs/LoopKit.md for full context and testing notes.
loopkitdev
added a commit
to loopkitdev/LoopKit
that referenced
this pull request
Mar 12, 2026
Resolved 16 conflicts across 15 files + project.pbxproj: Kept DIY (protect inline algorithm / active UI): - LoopKit/LoopAlgorithm/LoopAlgorithm.swift: kept (DIY inline; fix: correct < vs > in precondition msg) - LoopKit/LoopAlgorithm/LoopPredictionOutput.swift: kept (DIY inline; fix: wrong CodingKey for predictedGlucose) - LoopKit/InsulinKit/ExponentialInsulinModel.swift: kept (DIY inline; fix: missing closing paren in debugDescription) - LoopKitUI/View Controllers/OverrideSelectionViewController.swift: kept (DIY Loop still depends on it; crash fix LoopKit#540) Took Tidepool's: - LoopKitUI/Views/GlucoseValuePicker.swift: selectableValues now caller-provided (cleaner API) - LoopKitUI/Extensions/QuantityFormatter+Guardrails.swift: HKQuantity → LoopQuantity - LoopKitTests/AlertTests.swift: specific JSON encoding assertions - LoopKitTests/GuardrailTests.swift: LoopQuantity, new maxSuspendThreshold API - LoopKitTests/DoseStoreTests.swift: async DoseStore init, new API - LoopKit/InsulinKit/DoseStore.swift: improved async addPumpEvents logging - .circleci/config.yml: Xcode 26.1.1, iPhone 17 destination Manual merges (best of both): - LoopKit/Extensions/Guardrail+Settings.swift: LoopQuantity types + Tidepool's cleaner bounds - LoopKit/QuantityFormatter.swift: LoopUnit (Tidepool) + DIY's rule: parameter preserved - LoopKitUI/Views/Information Screens/GlucoseTherapySettingInformationView.swift: Tidepool's LoopQuantity API + preserved DIY's workoutCorrectionRangeOverride case - MockKitUI/Views/MockCGMManagerSettingsView.swift: kept both heartbeatSubSection (Tidepool) and settingsSubSection (DIY debug features) - LoopKit.xcodeproj/project.pbxproj: merged all file refs from both sides; deployment target 15.1 → 17.0 (Tidepool); preserved LOCALIZATION_PREFERS_STRING_CATALOGS See sync-docs/LoopKit.md for full context and testing notes.
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.
Screen recording of crash:
https://github.com/user-attachments/assets/500ebf9a-6bbc-4884-9a47-c9faf9b66a4b

Reported by @bedtime4bonzos (LoopKit/Loop#2210)
Proposed fix
It feels like this wasn't an issue until the override history was added. But the fix is to check what the greater allowed index is, and everything above it to cap at the original index