feat(desktop-client): queue account probes and report health to server
Replace serial probe-on-lock with a bounded probe queue (concurrency 3) that adds a "queued" probe state, manual cooldown, and retry backoff. After each probe the runtime debounces a batched POST to the new /desktop/accounts/health-reports endpoint so the server learns about live, expired, and risk transitions without waiting for a re-bind. Adds an account-scoped IPC (probeRuntimeAccount + runtimeAccountSnapshot) so the renderer can refresh a single row instead of replaying the full snapshot, and exposes the resulting "重新校验" action in AccountsView/AiPlatformsView. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
type ClientErrorTone = "error" | "warning";
|
||||
type ClientActionKind = "bind-account" | "open-console" | "unbind-account";
|
||||
type ClientActionKind = "bind-account" | "open-console" | "probe-account" | "unbind-account";
|
||||
|
||||
interface ClientErrorPresentation {
|
||||
tone: ClientErrorTone;
|
||||
@@ -42,7 +42,9 @@ function presentClientError(kind: ClientActionKind, error: unknown): ClientError
|
||||
? "账号绑定失败"
|
||||
: kind === "unbind-account"
|
||||
? "账号解绑失败"
|
||||
: "打开平台失败",
|
||||
: kind === "probe-account"
|
||||
? "账号校验失败"
|
||||
: "打开平台失败",
|
||||
);
|
||||
|
||||
if (message === "desktop_account_bind_window_closed") {
|
||||
@@ -110,6 +112,14 @@ function presentClientError(kind: ClientActionKind, error: unknown): ClientError
|
||||
};
|
||||
}
|
||||
|
||||
if (kind === "probe-account") {
|
||||
return {
|
||||
tone: "error",
|
||||
title: "账号校验失败",
|
||||
content: message,
|
||||
};
|
||||
}
|
||||
|
||||
if (kind === "unbind-account") {
|
||||
return {
|
||||
tone: "error",
|
||||
|
||||
Reference in New Issue
Block a user