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:
@@ -126,6 +126,13 @@ export interface DesktopAccountInfo {
|
||||
display_name: string;
|
||||
avatar_url: string | null;
|
||||
health: "live" | "expired" | "captcha" | "risk";
|
||||
runtime_health?: "live" | "expired" | "captcha" | "risk" | null;
|
||||
runtime_verified_at?: string | null;
|
||||
runtime_checked_at?: string | null;
|
||||
runtime_auth_state?: "unknown" | "active" | "expiring_soon" | "challenge_required" | "expired" | "revoked" | null;
|
||||
runtime_probe_state?: "queued" | "idle" | "probing" | "network_error" | null;
|
||||
runtime_auth_reason?: string | null;
|
||||
health_source?: "database" | "runtime";
|
||||
client_id: string | null;
|
||||
account_fingerprint: string | null;
|
||||
verified_at: string | null;
|
||||
@@ -158,6 +165,29 @@ export interface PatchDesktopAccountRequest {
|
||||
if_sync_version: number;
|
||||
}
|
||||
|
||||
export interface DesktopAccountHealthReport {
|
||||
account_id: string;
|
||||
platform: string;
|
||||
platform_uid: string;
|
||||
health: "live" | "expired" | "captcha" | "risk";
|
||||
auth_state: "unknown" | "active" | "expiring_soon" | "challenge_required" | "expired" | "revoked";
|
||||
probe_state: "queued" | "idle" | "probing" | "network_error";
|
||||
auth_reason?: string | null;
|
||||
display_name?: string | null;
|
||||
avatar_url?: string | null;
|
||||
verified_at?: string | null;
|
||||
checked_at: string;
|
||||
}
|
||||
|
||||
export interface ReportDesktopAccountHealthRequest {
|
||||
reports: DesktopAccountHealthReport[];
|
||||
}
|
||||
|
||||
export interface ReportDesktopAccountHealthResponse {
|
||||
accepted_count: number;
|
||||
buffered_count: number;
|
||||
}
|
||||
|
||||
export interface DesktopTaskInfo {
|
||||
id: string;
|
||||
job_id: string;
|
||||
|
||||
Reference in New Issue
Block a user