You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Introduce a MonitoringState machine (Running / Paused / Stopped) inside the root-level core crate and stop tying the app process lifecycle to the main window's close event.
Workspace Context
core::monitoring lives at core/src/monitoring/ in the workspace core crate; lifecycle wiring lives at src-tauri/src/app/lifecycle.rs and depends on the core crate.
Scope
Add core::monitoring::MonitoringState with explicit transitions in core/src/monitoring/.
Move start/stop wiring into app::lifecycle (src-tauri/src/app/lifecycle.rs).
on_window_event(CloseRequested) no longer calls WorkersState::terminate_all() and no longer calls app.exit(0). It hides the window instead.
An explicit Quit action (initially behind a debug flag or hidden setting) stops Core cleanly: state machine → Stopped, persistence flush, then app.exit(0).
With the debug flag enabled, the app keeps running with no visible window; collector and persistence continue.
Quit exits cleanly with no orphaned tasks and DB writes flushed.
MonitoringState transitions have unit tests covering all valid and invalid transitions, runnable via cargo test -p <core-crate> without a Tauri runtime.
Parent
Part of #1402. Depends on Phase 4.
Goal
Introduce a
MonitoringStatemachine (Running/Paused/Stopped) inside the root-levelcorecrate and stop tying the app process lifecycle to the main window's close event.Workspace Context
core::monitoringlives atcore/src/monitoring/in the workspacecorecrate; lifecycle wiring lives atsrc-tauri/src/app/lifecycle.rsand depends on thecorecrate.Scope
core::monitoring::MonitoringStatewith explicit transitions incore/src/monitoring/.app::lifecycle(src-tauri/src/app/lifecycle.rs).on_window_event(CloseRequested)no longer callsWorkersState::terminate_all()and no longer callsapp.exit(0). It hides the window instead.Quitaction (initially behind a debug flag or hidden setting) stops Core cleanly: state machine →Stopped, persistence flush, thenapp.exit(0).Out of Scope
Definition of Done
Quitexits cleanly with no orphaned tasks and DB writes flushed.MonitoringStatetransitions have unit tests covering all valid and invalid transitions, runnable viacargo test -p <core-crate>without a Tauri runtime.Notes
This phase is intentionally invisible to end users. The visible UX changes (tray menu, "close to tray" setting, first-run dialog) are owned by #1275.