fix(runs): stop claiming the hub is unreachable on RPC-level errors

The runs monitor folded every load failure into 'hub not reachable',
contradicting the sidebar's green connected dot whenever the hub
answered but the RPC failed — most visibly against a pre-0.22 hub
whose version predates the ListInvocations RPC (UNIMPLEMENTED).

Classify the failure instead (top-level, unit-tested):
- UNIMPLEMENTED -> 'this view needs a newer hub version' with a
  doctor-page link (the update banner lives there)
- FAILED_PRECONDITION from the detached gate -> the regular
  feature-off empty state with the guide button
- UNAVAILABLE / DEADLINE_EXCEEDED / socket-level failures -> the
  honest 'hub not reachable' state (unchanged)
- everything else -> a load-failed state with the friendly error
  and a copyable detail box

The error view is a public callback-driven widget so the tests pump
each variant without a live hub. New DE+EN strings for the too-old
and load-failed states; grpcCodeOf/grpcMessageOf exposed from the
friendly-error mapper instead of duplicating the duck-typing.

Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
This commit is contained in:
flemming-it 2026-07-18 17:33:11 +02:00
parent b47d8c4646
commit ea2cd87b5e
8 changed files with 380 additions and 7 deletions

View file

@ -1773,6 +1773,10 @@
"runsEmptyHint": "Hier erscheinen Läufe, die im Hintergrund weiterlaufen, während Sie anderes tun. Diese Funktion ist optional und standardmäßig ausgeschaltet — die Anleitung zeigt Schritt für Schritt, wie sie eingeschaltet wird.",
"runsEmptyEnabledHint": "Läufe im Hintergrund sind eingeschaltet — es wurde nur noch keiner gestartet. Starten Sie einen Flow mit der Option „im Hintergrund ausführen“, dann erscheint er hier.",
"runsEmptyGuideButton": "Anleitung öffnen",
"runsHubTooOldTitle": "Diese Ansicht braucht eine neuere Hub-Version",
"runsHubTooOldHint": "Der Hub ist verbunden, aber seine Version kennt die Laufübersicht noch nicht. Aktualisieren Sie den Hub, dann erscheinen die Läufe hier.",
"runsHubTooOldButton": "Diagnose öffnen",
"runsLoadFailedTitle": "Läufe konnten nicht geladen werden",
"runsCancelButton": "Abbrechen",
"runsCancelSignalled": "Abbruch für {flow} ausgelöst.",
"@runsCancelSignalled": {"placeholders": {"flow": {"type": "String"}}},

View file

@ -1812,6 +1812,10 @@
"runsEmptyHint": "Runs that keep working in the background while you do something else appear here. The feature is optional and off by default — the guide shows step by step how to turn it on.",
"runsEmptyEnabledHint": "Background runs are switched on — none has been started yet. Start a flow with the \"run in background\" option and it will appear here.",
"runsEmptyGuideButton": "Open the guide",
"runsHubTooOldTitle": "This view needs a newer hub version",
"runsHubTooOldHint": "The hub is connected, but its version does not know the runs monitor yet. Update the hub and the runs will appear here.",
"runsHubTooOldButton": "Open Doctor",
"runsLoadFailedTitle": "Runs could not be loaded",
"runsCancelButton": "Cancel",
"runsCancelSignalled": "Cancel signalled for {flow}.",
"@runsCancelSignalled": {"placeholders": {"flow": {"type": "String"}}},

View file

@ -5401,6 +5401,30 @@ abstract class AppLocalizations {
/// **'Open the guide'**
String get runsEmptyGuideButton;
/// No description provided for @runsHubTooOldTitle.
///
/// In en, this message translates to:
/// **'This view needs a newer hub version'**
String get runsHubTooOldTitle;
/// No description provided for @runsHubTooOldHint.
///
/// In en, this message translates to:
/// **'The hub is connected, but its version does not know the runs monitor yet. Update the hub and the runs will appear here.'**
String get runsHubTooOldHint;
/// No description provided for @runsHubTooOldButton.
///
/// In en, this message translates to:
/// **'Open Doctor'**
String get runsHubTooOldButton;
/// No description provided for @runsLoadFailedTitle.
///
/// In en, this message translates to:
/// **'Runs could not be loaded'**
String get runsLoadFailedTitle;
/// No description provided for @runsCancelButton.
///
/// In en, this message translates to:

View file

@ -3198,6 +3198,20 @@ class AppLocalizationsDe extends AppLocalizations {
@override
String get runsEmptyGuideButton => 'Anleitung öffnen';
@override
String get runsHubTooOldTitle =>
'Diese Ansicht braucht eine neuere Hub-Version';
@override
String get runsHubTooOldHint =>
'Der Hub ist verbunden, aber seine Version kennt die Laufübersicht noch nicht. Aktualisieren Sie den Hub, dann erscheinen die Läufe hier.';
@override
String get runsHubTooOldButton => 'Diagnose öffnen';
@override
String get runsLoadFailedTitle => 'Läufe konnten nicht geladen werden';
@override
String get runsCancelButton => 'Abbrechen';

View file

@ -3195,6 +3195,19 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get runsEmptyGuideButton => 'Open the guide';
@override
String get runsHubTooOldTitle => 'This view needs a newer hub version';
@override
String get runsHubTooOldHint =>
'The hub is connected, but its version does not know the runs monitor yet. Update the hub and the runs will appear here.';
@override
String get runsHubTooOldButton => 'Open Doctor';
@override
String get runsLoadFailedTitle => 'Runs could not be loaded';
@override
String get runsCancelButton => 'Cancel';