Repository navigation
Stop AlarmKit alarms after a relaunch - #2590
Merged
Merged
Conversation
The alarm scheduled for an urgent low was tracked only in memory, so once Loop was relaunched, acknowledging or retracting the alert could no longer find the alarm to stop it, and AlarmKit kept it alerting. Stop and cancel errors were also discarded. The alarm ID is now derived from the alert identifier, so any process can find it. Cancelling looks the alarm up in AlarmManager, stops it if it is alerting or cancels it if it is only scheduled, and logs failures.
ps2
added a commit
to LoopKit/LoopWorkspace
that referenced
this pull request
Oct 19, 2026
Loop: issue reports to the LoopKit developers (LoopKit/Loop#2585), even alarm loudness (LoopKit/Loop#2589), stop AlarmKit alarms after a relaunch (LoopKit/Loop#2590), alarms play through silent mode (LoopKit/Loop#2591), carb entry sync identifier (LoopKit/Loop#2587). LoopKit: watch glucose duplicate crash (LoopKit/LoopKit#655), chart back-gesture (LoopKit/LoopKit#656, LoopKit/LoopKit#658), iOS 17.6 and watchOS 10.6 (LoopKit/LoopKit#659), previous pump's reservoir values (LoopKit/LoopKit#657), carb entry sync identifier (LoopKit/LoopKit#654). LibreLoop: not-an-Abbott-product notice (LoopKit/LibreLoop#25), iOS 17.6 (LoopKit/LibreLoop#26), backfilled readings in Recent Readings (LoopKit/LibreLoop#27). LibreTransmitter: forward the newest trend reading (LoopKit/LibreTransmitter#58). EversenseKit and MixpanelService: iOS 17.6 (LoopKit/EversenseKit#7, LoopKit/MixpanelService#9).
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.
The AlarmKit alarm scheduled for an urgent low was tracked only in memory, so once Loop was relaunched, acknowledging or retracting the alert could no longer find the alarm, and it kept alerting. This matches a report on #2481 of the alarm still showing after the alert was acknowledged. Stop and cancel errors were also discarded.
The alarm ID is now a UUID derived from the alert identifier (SHA-256, version 5 layout), so any process can find it. Cancelling looks the alarm up in
AlarmManager.shared.alarms, stops it if it is alerting or cancels it if it is only scheduled, and logs failures.Built and installed on an iPhone with the other alert changes; the relaunch case hasn't been reproduced on purpose.