Repository navigation
Conversation
… 30 seconds Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
[Medium impact] The PR appears safe to merge. SummaryReplaces the 30-second battery check with UPower change signals.
Reviews (1) · Last reviewed commit: "Check for a low battery when UPower repo..." · Reviewed by Greptile |
3 of 5 tasks
Contributor
|
Tested
|
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.
What changes
The battery service re-read the battery on a 30-second timer, all day, for the whole session. UPower's display device already signals each change to what the check reads (percentage, state, presence, readiness), so the check now runs on those signals and the timer is gone. The warning now goes out the moment the level crosses the threshold, instead of up to 30 seconds later.
The check also waits until UPower has filled in the device. It arrives one property at a time at startup, and a check against a half-read device cleared the "already warned" flag that persists across shell reloads, so a reload at low battery warned a second time. Running on UPower's signals is what exposes the check to that half-read device, so the guard belongs with this change.
The manifest description now mentions the service's other job, switching power profiles with the power source.
Interaction with #8284. #8284 holds low-battery warnings for five seconds after the shell starts (stale UPower state after resume, #7679), and counts on the 30-second timer this PR removes to run the first check once that window ends. Combined as they stand, nothing would check when the window ends, and the first warning would wait for the next percentage or state change. Whichever lands second should run
checkBattery()when #8284's gate opens. Both PRs also wait forUPower.displayDevice.ready, so one of those checks can go.Verification
battery-test.sh,battery-status-test.shandbattery-present-test.shpass.quattromerged in: the service loads in the running shell, itsbatteryIPC target answers, andshell-idle-spawn-test.shpasses (an idle shell starts no processes over 30 seconds).readyguard skipped the checks while UPower still read 0%.Screenshots
No visible change: the low-battery notification looks the same; only when the check runs changes.
🤖 Generated with Claude Code