Skip to content

Remove sparkle, remove network entitlements#4

Closed
javaidea wants to merge 1 commit into
domzilla:masterfrom
javaidea:develop
Closed

Remove sparkle, remove network entitlements#4
javaidea wants to merge 1 commit into
domzilla:masterfrom
javaidea:develop

Conversation

@javaidea
Copy link
Copy Markdown

Remove sparkle, remove network entitlements

@javaidea javaidea closed this Oct 14, 2024
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant