ui: detect outdated daemon via WailsUIReady probe

Add a no-op WailsUIReady RPC the UI probes once at startup. A reachable
daemon that returns Unimplemented predates this UI and is too old to
drive it; the probe distinguishes that from an unreachable daemon. On an
outdated daemon the UI fires a localized OS notification, since the main
window may not open to show an in-app error.

Proto regenerated with protoc 33.1 to keep the v6.33.1 header.
This commit is contained in:
Zoltán Papp
2026-06-17 13:00:13 +02:00
parent 4ee691d0d6
commit fedef7588f
17 changed files with 505 additions and 219 deletions
+19
View File
@@ -0,0 +1,19 @@
import { Compat } from "@bindings/services";
let cached: boolean | null = null;
/**
* isDaemonCompatible probes whether the running daemon implements the WailsUIReady
* RPC. A false result means the daemon predates this UI (Unimplemented) and is too
* old to drive it. The Go side returns an error instead when the daemon is simply
* unreachable, so a throw here is NOT an outdated daemon — treat it as "unknown"
* and let the normal connection flow report it.
*
* The result is cached for the session: daemon identity does not change without a
* UI restart, and a freshly started daemon is reachable again under the same socket.
*/
export async function isDaemonCompatible(): Promise<boolean> {
if (cached !== null) return cached;
cached = await Compat.DaemonReady();
return cached;
}