mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-10-06 07:15:09 +00:00
fix(display): a failed on-demand request drops the session it ended
_set_on_demand_error ends any running session (_reset_on_demand_fields) but left its saved copy, display_on_demand_config, in the cache. A failed request that replaced a running session therefore made the next restart resume the session that had already ended. Clear the saved copy where every error path goes through, and drop the two restore-failed callers' own clears, which this now covers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -217,6 +217,15 @@ class TestReleasingThePlugin:
|
||||
assert controller.current_display_mode == 'clock'
|
||||
assert controller.force_change is True
|
||||
|
||||
def test_a_failed_request_that_ends_the_session_drops_its_saved_copy(self, controller):
|
||||
"""Otherwise the next restart resumes the session that just ended."""
|
||||
_start(controller, plugin_id='clock')
|
||||
controller.cache_manager.clear_cache.reset_mock()
|
||||
|
||||
_start(controller, plugin_id='uninstalled')
|
||||
|
||||
controller.cache_manager.clear_cache.assert_called_once_with('display_on_demand_config')
|
||||
|
||||
def test_a_plugin_enabled_during_the_session_stays_loaded(self, controller):
|
||||
_start(controller)
|
||||
controller.test_config['preview-me'] = {'enabled': True}
|
||||
|
||||
Reference in New Issue
Block a user