fix(studio): daemon-start probes health first + shows a readable error
Some checks failed
Security / Security check (push) Failing after 2s

'Tap to start' on an already-running hub reported 'daemon could not be
started' (the start failed because it was already up) then flashed the
error away as a SnackBar — confusing next to the sidebar's 'connected'.
Now: on a failed start, probe the hub; if it answers, just connect (no
false error). If it is genuinely down, show the daemon's stderr in a
persistent, copyable dialog (showFaiProcessErrorDialog) instead of a
SnackBar that vanishes before the operator can read or copy it.

Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
This commit is contained in:
flemming-it 2026-06-18 16:17:26 +02:00
parent 57dac3d999
commit 62ed3951e5
2 changed files with 59 additions and 23 deletions

View file

@ -109,6 +109,27 @@ void showFaiProcessError(
);
}
/// Like [showFaiProcessError] but as a persistent modal dialog. Use for
/// failures the operator needs time to read and copy (a daemon that
/// won't start) — a SnackBar flashes away before they can act on it.
Future<void> showFaiProcessErrorDialog(
BuildContext context,
String source,
String stdout,
String stderr, {
String? title,
}) {
final detail = [stderr.trim(), stdout.trim()]
.where((s) => s.isNotEmpty)
.join('\n\n');
return showFaiErrorDialog(
context,
source,
detail.isEmpty ? 'process exited non-zero (no output)' : detail,
title: title,
);
}
/// Show [error] as a centered modal dialog. Use this when the
/// failure blocks meaningful interaction (auth missing, hub
/// unreachable) a SnackBar would be too easy to dismiss.