Repository navigation
Conversation
testRescheduleMutedLoopNotLoopingAlerts failed now and then on the first run after a simulator had been idle. Changing the muter reschedules the loop-not-running notifications from ExtensionDataManager.lastLoopCompleted, which the host app refreshes only after launch; a value more than 20 minutes old schedules nothing, leaving the unmuted notifications from loopDidComplete in place. Earlier runs also leave a 4-hour mute in UserDefaults, which hides the problem until it expires. The test now sets the last loop date it reschedules from, and reads the pending notifications until the muted versions replace the others, for up to 5 seconds, instead of reading them once.
Camji55
approved these changes
Oct 19, 2026
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.
testRescheduleMutedLoopNotLoopingAlertsfails now and then (XCTAssertNilon the time-sensitive notification's sound), usually on the first run after the simulator has been idle. Marion hit it while testing #2588.Cause
Changing the muter reschedules the loop-not-running notifications from
ExtensionDataManager.lastLoopCompleted, shared app-group data that the host app refreshes 0.5 s after launch. On the first run after an idle period, that value is more than 20 minutes old, so the muted reschedule schedules nothing, and the unmuted notifications fromloopDidCompletestay pending with sound. Earlier runs also save a 4-hour mute inUserDefaults, which mutes the first scheduling pass and hides the problem until it expires. The test also read the pending notifications once, possibly before the muted versions had replaced the others.Change
loopDidComplete.Testing
AlertManagerTests: 21 pass on an iPhone 17 Pro simulator.