Skip to content

fix: a Vegas static pause survives a non-numeric display duration; aliased store installs ask for a restart - #753

Open
ChuckBuilds wants to merge 2 commits into
mainfrom
fix/static-pause-duration-install-restart
Open

ChuckBuilds wants to merge 2 commits into
mainfrom
fix/static-pause-duration-install-restart

Conversation

@ChuckBuilds

Copy link
Copy Markdown
Owner

Two small follow-ups to #739 and #746, one commit each.

1. A Vegas static pause reads the display duration the way the rotation does

VegasModeCoordinator._handle_static_pause compared plugin.get_display_duration() with the clock. clock-simple, calendar and countdown return display_duration as it is in config.json, so a value saved as "20", null or "twenty" raised a TypeError there. It didn't crash, because the pause's broad except caught it, but that ended the pause: the plugin flashed up and the scroll went straight on, at every one of its turns. Other values went wrong too: inf held the pause until something interrupted it, and NaN, False, 0 or a negative number ended it at once.

2. A store install checks restart_required under the installed id

POST /api/v3/plugins/install decided restart_required by looking for the plugin's enabled flag under the registry id. An aliased entry installs under a different id: weather installs with manifest id ledmatrix-weather, and its config section is ledmatrix-weather. So reinstalling an enabled Weather, Music, Stocks or Leaderboard never reported that a restart was needed, and the display kept running the copy it had loaded. Both the queued and the direct path now call #746's _installed_plugin_id() once and use the result for the plugin_id they return and for the enabled check.

Tests (written first)

  • test/test_vegas_static_pause_duration.py runs on a fake clock. It covers:
    • pause lengths for numbers and numeric strings, non-numbers (30 s), values ≤ 0 (15 s) and a raising get_display_duration();
    • that the pause can still be interrupted;
    • the warning being logged once per plugin;
    • a finite_seconds table;
    • TestSameAsTheRotation, which runs every value through both the pause and the rotation's _get_display_duration → _resolve_durations and checks they agree.
  • test/test_api_v3_install_restart_installed_id.py uses the Flask test client on the direct and queued paths. It checks:
    • aliased and enabled under the installed id → restart required;
    • enabled only under the registry id → no restart;
    • not enabled → no restart;
    • a plugin installed under its own id, and an install whose manifest can't be found → unchanged.
  • On origin/main 2236ff30: 61 fail and 7 pass. The 7 are guards for values that already worked. On this branch: all 68 pass.
  • Neighbouring suites, including fix(display): a non-numeric plugin duration no longer stops the display; narrow scroll strips no longer raise #739's test_display_duration_not_a_number.py with the helper moved, the Vegas tests and the store tests: 1047 passed.
  • Full suite, compared against a baseline worktree of main on the same Windows host: identical FAILED/ERROR lists (62 failed and 6 errors, all pre-existing on this host, in both trees); the branch passes 68 more tests (8556 vs 8488).
  • flake8 with the pre-commit selection reports nothing new. The 8 findings in display_controller.py are the same 8 that main has.

Merge notes

Based on origin/main 2236ff30, after #738–#747 landed. The CHANGELOG bullets go at the end of Unreleased → Fixes. git merge-tree against the open PRs:

🤖 Generated with Claude Code

ChuckBuilds and others added 2 commits October 3, 2026 22:31
… a static pause

The Vegas static pause compared plugin.get_display_duration() with the
clock. clock-simple, calendar and countdown return their display_duration
setting straight from config.json, so a value saved as "20" or null
reached that comparison as a string or None. The TypeError went to the
pause's broad except, which ended the pause: the plugin flashed up and
the scroll went straight on, at every one of its turns. inf held the
pause until something interrupted it, and NaN, False, 0 or a negative
number ended it at once.

The pause now reads the duration the way the rotation has since #739,
with the same helper, then the rotation's fallbacks: 30 s for anything
that is not a number or a get_display_duration() that raises, 15 s for a
number at or below zero. Logged once per plugin. test_vegas_static_mode.py's
pauses used 0 to mean "no wait"; they now use 0.01.

The helper moves from display_controller (_finite_seconds) to base_plugin
(finite_seconds), unchanged: the coordinator cannot import from
display_controller, which imports src.vegas_mode at module level, and a
new src module would turn ledmatrix-plugins' min-core table check red
until it was listed. base_plugin is already loaded whenever either one is.

Tests: test/test_vegas_static_pause_duration.py, on a fake clock,
including TestSameAsTheRotation, which runs every value through both the
pause and the rotation's _get_display_duration/_resolve_durations.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
POST /plugins/install decides restart_required from whether config.json
already enables the plugin: the display loads a plugin when its enabled
flag changes, so one already enabled (a reinstall, or a config carried
over) keeps running the copy it loaded until a restart. The route read
that flag under the registry id. Weather, Music, Stocks and Leaderboard
install under the id their manifests declare (weather ->
ledmatrix-weather), which is the config section's id, so reinstalling an
enabled one never reported that a restart was needed.

Both the queued and the direct path now look up the installed id once
(#746's _installed_plugin_id) and use it for the plugin_id they answer
with and for the enabled check.

Tests: test/test_api_v3_install_restart_installed_id.py, through the
Flask test client, both paths.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 49 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: eb4c3bc7-fb9a-4b4f-91c9-eacdf8f79148
📥 Commits

Reviewing files that changed from the base of the PR and between 2236ff3 and 3d5a7cd.

📒 Files selected for processing (8)
  • CHANGELOG.md
  • src/display_controller.py
  • src/plugin_system/base_plugin.py
  • src/vegas_mode/coordinator.py
  • test/test_api_v3_install_restart_installed_id.py
  • test/test_vegas_static_mode.py
  • test/test_vegas_static_pause_duration.py
  • web_interface/blueprints/api_v3/plugin_store.py
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 17 complexity

Metric Results
Complexity 17

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

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