Fix: use correct method name in on_change_state D-Bus handler#570
Merged
Core447 merged 1 commit intoMar 7, 2026
Merged
Conversation
on_change_state in app.py and the api_state_requests handler in DeckController.py both call get_best_page_path_match_from_name, which does not exist on PageManagerBackend. The correct method is find_matching_page_path, matching on_change_page and api_page_requests. This causes --change-state CLI commands to fail silently (AttributeError swallowed by GTK's action handler) when SC is running, and crash at startup when SC is not running.
8ad3c6b to
771c328
Compare
There was a problem hiding this comment.
Pull request overview
Fixes the --change-state CLI path resolution by calling the correct PageManagerBackend method, ensuring state-change requests actually resolve a page and execute instead of failing silently.
Changes:
- Update
on_change_state(D-Bus handler) to usefind_matching_page_path(). - Update queued startup processing (
api_state_requests) to usefind_matching_page_path().
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/app.py |
Fixes D-Bus on_change_state page lookup to use the existing page-matching API. |
src/backend/DeckManagement/DeckController.py |
Fixes queued state-change request handling at startup to resolve page paths via the correct method. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Member
|
Thank you! |
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.
Summary
The
--change-stateCLI feature (added in #460) callsgl.page_manager.get_best_page_path_match_from_name(), but this method does not exist onPageManagerBackend. The correct method isfind_matching_page_path(), which is whaton_change_pageand theapi_page_requestshandler already use correctly.Two call sites are affected:
src/app.py—on_change_stateD-Bus handler (used when SC is already running)src/backend/DeckManagement/DeckController.py—api_state_requestshandler (used when SC is not running and processes queued requests at startup)The
AttributeErroris silently swallowed by GTK's action handler, so--change-stateexits successfully but has no effect.Fixes #571
Fix
Replace
get_best_page_path_match_from_namewithfind_matching_page_pathin both call sites.Testing
Verified on a live StreamController instance (installed via AUR
streamcontroller-git):streamcontroller --change-state AL08L2C53065 Desktop 4,1 1exits silently with no effect, no log outputSuccessfully changed state of (4,1) to state 1 on device AL08L2C53065