Fix inverted app enable/disable state write - #1445
Merged
helto4real merged 1 commit intoSep 5, 2026
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1445 +/- ##
====================================
Coverage 82% 83%
====================================
Files 201 201
Lines 4165 4165
Branches 485 485
====================================
+ Hits 3450 3461 +11
+ Misses 509 499 -10
+ Partials 206 205 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
AppStateManager.SaveStateAsync passed the current enabled flag to UpdateAsync instead of the desired one, so enabling an app that was off sent turn_off and disabling an app that was on sent turn_on. Pass the desired state and assert the exact service in the tests. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014w4cLiriBNpmBbY1Xpw8gV
helto4real
force-pushed
the
fix/app-state-inverted-write
branch
from
September 5, 2026 10:27
b48aeb5 to
65e77f6
Compare
helto4real
approved these changes
Sep 5, 2026
helto4real
left a comment
Collaborator
There was a problem hiding this comment.
The fix correctly persists the requested enabled state, and the strengthened assertions cover both turn_on and turn_off. All 50 runtime tests passed on the reviewed pre-rebase commit; the diff is unchanged after rebasing onto current main. Approved, with merge pending the required CI checks on the rebased commit.
helto4real
enabled auto-merge (squash)
September 5, 2026 10:28
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.
Proposed change
AppStateManager.SaveStateAsynconly callsIAppStateRepository.UpdateAsyncwhen the requestedApplicationStatediffers from the currentinput_booleanstate, but it passed the currentisEnabledvalue instead of the desired one. As a result every real write did the opposite of what was requested:SaveStateAsync(id, Enabled)while the helper isoffsentinput_boolean.turn_offSaveStateAsync(id, Disabled)while the helper isonsentinput_boolean.turn_onThis PR passes
state == ApplicationState.EnabledtoUpdateAsyncso the helper is set to the desired state.The existing
AppStateManagerTestsonly verified that somecall_servicecommand was sent, which is why this slipped through. The two affected tests now assert the exact domain and service (input_boolean.turn_off/input_boolean.turn_on) and that it is sent exactly once. Both tests fail against the previous code and pass with the fix.Type of change
Additional information
Found during a code review of the runtime; no issue was filed for it. The bug only affects users who opt in via
AddNetDaemonStateManager().Checklist
If user exposed functionality or configuration are added/changed: