Корректное ожидание подтверждения Bridge

This commit is contained in:
DCCONSTRUCTIONS
2026-08-23 12:14:56 +03:00
parent 7d911b4b1f
commit 456141a3f3
4 changed files with 133 additions and 12 deletions
@@ -466,6 +466,26 @@ export function sourceStatusLabel(state: XgridsK1State | null | undefined): stri
return "Ожидание";
}
/**
* The network write has already crossed its single mutation boundary and the
* service is now proving control authority without another BLE command. This
* current connection intent must remain visibly pending even when an older
* physical-command checkpoint is being reconciled by the same bootstrap.
*/
export function isConnectionControlBootstrapSettling(
state: XgridsK1State | null | undefined,
): boolean {
const attempt = state?.connection_attempt;
if (
!attempt
|| attempt.phase !== "network_applied"
|| attempt.control_state !== "unknown"
) return false;
if (["accepted", "running"].includes(attempt.status)) return true;
return attempt.status === "succeeded"
&& attempt.safe_next_action === "verify-control-read-only";
}
export function operationByIdempotencyKey(
state: XgridsK1State | null | undefined,
action: string,