Skip to content

Stop the Pomodoro before the plugins when the application exits - #182

Merged
vesnicancz merged 1 commit into
masterfrom
fix/pomodoro-stops-before-plugins
Nov 5, 2026
Merged

vesnicancz merged 1 commit into
masterfrom
fix/pomodoro-stops-before-plugins

Conversation

@vesnicancz

Copy link
Copy Markdown
Owner

PomodoroService.DisposeAsync turns the status indicators off, but it only ran when the host was disposed, and by then App.ShutdownCleanup had already disposed the plugins. The list of running indicators was empty, so the code did nothing, and the LED went dark only if the plugin did that itself on shutdown. The Pomodoro timer also kept running while the plugins were shutting down, so a phase ending in that moment could still reach them.

What changes

  • App disposes the Pomodoro after plugin startup finishes and before the plugins. The order lives in StopPomodoroAndPluginsAsync so that a test can check it.
  • PomodoroService.DisposeAsync turns the indicators off only during a Pomodoro. Now that this code actually runs, it would otherwise send Idle on every exit, and Luxafor would open a device nothing had used just to turn it off.

Behavior to check

  • Exiting during a Pomodoro now sends Idle to the indicators first, and then Luxafor turns the device off again on its own shutdown. That's two commands with the same result, bounded by the existing 3-second timeout within the 10-second teardown limit.
  • Exiting outside a Pomodoro doesn't touch the indicators from the Pomodoro side.

Testing

  • All 1460 tests pass on Windows. New ones check the shutdown order, waiting for plugins that are still starting, and the indicator being turned off during a Pomodoro and left alone outside one.
  • Not tried: exiting the running app during a Pomodoro with a real Luxafor. The tests use mocks, so whether the LED goes dark at exit needs one try on the device.

@vesnicancz
vesnicancz force-pushed the fix/pomodoro-stops-before-plugins branch from 65a0d7a to fb30111 Compare November 5, 2026 12:51
@vesnicancz
vesnicancz merged commit 01a1aaf into master Nov 5, 2026
5 checks passed
@vesnicancz
vesnicancz deleted the fix/pomodoro-stops-before-plugins branch November 5, 2026 12:54
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