fix(k1): stabilize live recovery and media admission
This commit is contained in:
@@ -1875,6 +1875,20 @@ function invokeState(actionId: string, input: object = {}): Promise<XgridsK1Stat
|
||||
);
|
||||
}
|
||||
|
||||
let stateReadInFlight: Promise<XgridsK1State> | null = null;
|
||||
|
||||
function readStateSingleFlight(): Promise<XgridsK1State> {
|
||||
if (stateReadInFlight) return stateReadInFlight;
|
||||
|
||||
const request = invokeState(xgridsK1Actions.stateRead);
|
||||
stateReadInFlight = request;
|
||||
const release = () => {
|
||||
if (stateReadInFlight === request) stateReadInFlight = null;
|
||||
};
|
||||
void request.then(release, release);
|
||||
return request;
|
||||
}
|
||||
|
||||
export const xgridsK1Api = {
|
||||
async getHealth(): Promise<HealthResponse> {
|
||||
const payload = await requestJson(
|
||||
@@ -1890,7 +1904,7 @@ export const xgridsK1Api = {
|
||||
},
|
||||
|
||||
async getState(): Promise<XgridsK1State> {
|
||||
return invokeState(xgridsK1Actions.stateRead);
|
||||
return readStateSingleFlight();
|
||||
},
|
||||
|
||||
scanBle(
|
||||
|
||||
@@ -67,10 +67,12 @@ function RecoveryState({
|
||||
{copy.showSpinner ? <ActivityIndicator size="compact" /> : null}
|
||||
<div className="active-stream-recovery__copy">
|
||||
<strong>{copy.title}</strong>
|
||||
<span>{copy.detail}</span>
|
||||
{presentation?.progressLabel ? (
|
||||
<small>{presentation.progressLabel}</small>
|
||||
) : null}
|
||||
<span className="active-stream-recovery__detail">
|
||||
<span>{copy.detail}</span>
|
||||
{presentation?.progressLabel ? (
|
||||
<small>{presentation.progressLabel}</small>
|
||||
) : null}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -599,6 +599,12 @@ box-sizing: border-box;
|
||||
gap: 0.28rem;
|
||||
}
|
||||
|
||||
.active-stream-recovery__detail {
|
||||
display: grid;
|
||||
min-width: 0;
|
||||
gap: 0.28rem;
|
||||
}
|
||||
|
||||
.active-stream-recovery__copy strong {
|
||||
color: var(--nodedc-text-primary);
|
||||
font-size: 0.72rem;
|
||||
@@ -1023,25 +1029,83 @@ box-sizing: border-box;
|
||||
min-width: 0;
|
||||
grid-template-columns: minmax(0, 1fr) auto;
|
||||
align-items: center;
|
||||
gap: 0.65rem;
|
||||
column-gap: 0.75rem;
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.active-stream-recovery--compact .active-stream-recovery__state {
|
||||
grid-column: 1;
|
||||
grid-row: 1;
|
||||
min-width: 0;
|
||||
align-items: center;
|
||||
gap: 0.65rem;
|
||||
background: transparent;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.active-stream-recovery--compact
|
||||
.active-stream-recovery__state
|
||||
> .nodedc-activity-indicator {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.active-stream-recovery--compact .active-stream-recovery__copy {
|
||||
display: grid;
|
||||
min-width: 0;
|
||||
justify-items: center;
|
||||
gap: 0.1rem;
|
||||
overflow: hidden;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.active-stream-recovery--compact .active-stream-recovery__copy strong {
|
||||
max-width: 100%;
|
||||
overflow: hidden;
|
||||
font-size: 0.62rem;
|
||||
font-weight: 600;
|
||||
line-height: 1.35;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.active-stream-recovery--compact .active-stream-recovery__detail {
|
||||
display: flex;
|
||||
min-width: 0;
|
||||
max-width: 100%;
|
||||
align-items: baseline;
|
||||
justify-content: center;
|
||||
gap: 0.4rem;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.active-stream-recovery--compact .active-stream-recovery__detail > span {
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
font-size: 0.56rem;
|
||||
line-height: 1.35;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.active-stream-recovery--compact .active-stream-recovery__copy small {
|
||||
flex: 0 0 auto;
|
||||
font-size: 0.54rem;
|
||||
line-height: 1.35;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.active-stream-recovery--compact .active-stream-recovery__actions {
|
||||
max-width: 15rem;
|
||||
grid-column: 2;
|
||||
grid-row: 1;
|
||||
align-self: start;
|
||||
max-width: none;
|
||||
grid-template-columns: auto;
|
||||
justify-items: end;
|
||||
gap: 0.25rem;
|
||||
}
|
||||
|
||||
.active-stream-recovery--compact .active-stream-recovery__actions p {
|
||||
font-size: 0.5rem;
|
||||
line-height: 1.35;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.xgrids-k1-spatial-controls__phase {
|
||||
@@ -1155,14 +1219,10 @@ box-sizing: border-box;
|
||||
}
|
||||
|
||||
.active-stream-recovery--compact {
|
||||
grid-template-columns: minmax(0, 1fr);
|
||||
grid-template-columns: minmax(0, 1fr) auto;
|
||||
}
|
||||
|
||||
.active-stream-recovery--compact .active-stream-recovery__actions {
|
||||
max-width: none;
|
||||
}
|
||||
|
||||
.active-stream-recovery--compact .active-stream-recovery__actions p {
|
||||
display: none;
|
||||
grid-column: 2;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -248,7 +248,7 @@ export function connectionActionAuthoritySnapshot(
|
||||
}
|
||||
|
||||
const CONTROL_STATE_READ_INTERVAL_MS = 250;
|
||||
const CONTROL_PHASE_WAIT_TIMEOUT_MS = 35_000;
|
||||
const CONTROL_PHASE_WAIT_TIMEOUT_MS = 120_000;
|
||||
|
||||
function controlPhase(state: XgridsK1State): XgridsApplicationControlPhase {
|
||||
return state.application_control_session?.state ?? "idle";
|
||||
|
||||
Reference in New Issue
Block a user