Remove sparkle, remove network entitlements#4
Closed
javaidea wants to merge 1 commit into
Closed
Conversation
bubbleee030
added a commit
to bubbleee030/Caffeine
that referenced
this pull request
May 19, 2026
#1 SleepPreventionManager.refreshAssertions now creates the three new assertions before releasing the old IDs, so the kernel always sees at least one of each type during a refresh (swap-then-release, not release-then-create). The doc comment claimed overlap but the code left a microsecond gap. New testRefreshCreatesNewAssertionsBeforeReleasingOld pins the ordering via an operationLog on the test fake. domzilla#2 NSWorkspace session observers now use the Combine publisher API with AnyCancellable, so they detach automatically when the manager deallocates. The previous selector-based addObserver retained the target forever — fine for the production singleton, but every test that constructed a SleepPreventionManager(backend:) leaked two observers. testManagerDeallocatesWhenOutOfScope proves the leak is fixed via a weak ref. domzilla#3 LaunchAtLoginManager.setEnabled now logs the underlying error via os.Logger (subsystem net.domzilla.caffeine, visible in Console.app) and surfaces it on a public `lastError` property so the UI layer can present it to the user. refresh() still snaps the published isEnabled back to the backend truth, so a failed register visually pops the Toggle back to off. Two new tests cover lastError set on throw and cleared on next success. domzilla#4 scripts/integration-test.sh replaces the fixed 3 s sleep with a poll_for_caffeine_assertions helper that retries pmset every second until Caffeine-owned assertions appear (default 30 s timeout, overridable via ASSERTION_POLL_TIMEOUT). Avoids flakiness on slow runners where SwiftUI initialization takes longer than 3 s.
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.
Remove sparkle, remove network entitlements