mirror of
https://github.com/Studio-Saelix/sencho.git
synced 2026-08-08 18:05:10 +00:00
fix(mesh): probe upstream synchronously in route diagnostic (F-11) (#1100)
GET /api/mesh/aliases/:alias/diagnostic returned a cached state derived from the last latency/error maps. Those maps only mutated when someone called POST .../test or when a cross-node connect logged an event, so once an upstream stopped the diagnostic kept reporting "healthy" until the 60 s alias-cache refresh pruned the alias entirely. The GET now calls testUpstream synchronously after the alias-resolved, opted-in, tunnel-up short-circuits. Probe failures land in routeErrorMap via logActivity (cross-node already did this; same-node timeout/error paths now log probe.fail in the same shape), so the state computation flips to "unreachable" on the same request that exposed the stopped upstream. A new routeProbeAtMap stamps freshness and surfaces in the response as lastProbeAt; the route detail sheet renders "Last probe <age> · <ms>" using the existing formatTimeAgo helper.
This commit is contained in:
@@ -76,6 +76,8 @@ export interface MeshRouteDiagnostic {
|
||||
pilot: { connected: boolean; lastSeen: number | null };
|
||||
lastError: { ts: number; message: string } | null;
|
||||
lastProbeMs: number | null;
|
||||
/** Wall-clock ms epoch of the last probe attempt for this alias, or null if no probe has run. */
|
||||
lastProbeAt: number | null;
|
||||
state: 'healthy' | 'degraded' | 'unreachable' | 'tunnel down' | 'not authorized';
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user