Bug
The "Sleep" action (server card, server detail page, network context menu) is
shown/enabled whenever server.status === 'online'. But the frontend collapses
the backend's running-external lifecycle state — a server mserve only
observes/adopted, doesn't own — into that same 'online' status
(mapRuntimeStateToStatus in src/lib/server-telemetry.ts). Clicking Sleep on
an adopted server always fails.
Root cause
The backend sleep_server command
(src-tauri/src/app/commands/runtime.rs) requires LifecycleState::Online
specifically, plus an owned child process (runtime.child.is_some()). An
adopted server's backend state is RunningExternal, not Online, so the
guard rejects it with "Server must be online to sleep." — but the frontend has
no way to distinguish "owned online" from "adopted online" today, since
neither ServerRuntimeSnapshot nor the server-runtime-state event expose an
ownership flag to the UI.
Fix
Either:
- Expose an
isOwned/isExternal flag on the runtime snapshot and
server-runtime-state event so the frontend can hide Sleep (and any other
owned-only action) for adopted servers, or
- Have
sleep_server return a clearer, distinguishable error message the UI
can surface (e.g. "This server was started outside mserve and can't be put
to sleep"), matching the pattern already used in stop_server's
RCON-fallback error.
Affects: src/components/server-card.tsx, src/pages/network/ServerNodeMenu.tsx,
src/pages/server/server-overview-panel.tsx.
Bug
The "Sleep" action (server card, server detail page, network context menu) is
shown/enabled whenever
server.status === 'online'. But the frontend collapsesthe backend's
running-externallifecycle state — a server mserve onlyobserves/adopted, doesn't own — into that same
'online'status(
mapRuntimeStateToStatusinsrc/lib/server-telemetry.ts). Clicking Sleep onan adopted server always fails.
Root cause
The backend
sleep_servercommand(
src-tauri/src/app/commands/runtime.rs) requiresLifecycleState::Onlinespecifically, plus an owned child process (
runtime.child.is_some()). Anadopted server's backend state is
RunningExternal, notOnline, so theguard rejects it with "Server must be online to sleep." — but the frontend has
no way to distinguish "owned online" from "adopted online" today, since
neither
ServerRuntimeSnapshotnor theserver-runtime-stateevent expose anownership flag to the UI.
Fix
Either:
isOwned/isExternalflag on the runtime snapshot andserver-runtime-stateevent so the frontend can hide Sleep (and any otherowned-only action) for adopted servers, or
sleep_serverreturn a clearer, distinguishable error message the UIcan surface (e.g. "This server was started outside mserve and can't be put
to sleep"), matching the pattern already used in
stop_server'sRCON-fallback error.
Affects:
src/components/server-card.tsx,src/pages/network/ServerNodeMenu.tsx,src/pages/server/server-overview-panel.tsx.