fix(runner): detect active ACPX turns on close
This commit is contained in:
parent
a418938524
commit
a55b6e6409
|
|
@ -104,6 +104,17 @@ it("identifies an active provider turn that must stop before suspension", () =>
|
|||
providerSettled: false,
|
||||
});
|
||||
|
||||
expect(
|
||||
runnerdRecoveryInternals.providerDrainStateFromSnapshot({
|
||||
activeTurnId: "acpx-turn-1",
|
||||
pendingEvents: [],
|
||||
}),
|
||||
).toEqual({
|
||||
pendingEventCount: 0,
|
||||
activeProviderTurnId: "acpx-turn-1",
|
||||
providerSettled: false,
|
||||
});
|
||||
|
||||
expect(
|
||||
runnerdRecoveryInternals.providerDrainStateFromSnapshot({
|
||||
activeProviderTurnId: null,
|
||||
|
|
|
|||
|
|
@ -340,10 +340,9 @@ function providerDrainStateFromSnapshot(state: Record<string, unknown>): {
|
|||
? state.queuedEvents.length
|
||||
: 0;
|
||||
const activeProviderTurnId =
|
||||
typeof state.activeProviderTurnId === "string" &&
|
||||
state.activeProviderTurnId.length > 0
|
||||
? state.activeProviderTurnId
|
||||
: null;
|
||||
[state.activeProviderTurnId, state.activeTurnId].find(
|
||||
(value): value is string => typeof value === "string" && value.length > 0,
|
||||
) ?? null;
|
||||
return {
|
||||
pendingEventCount: pending + queued,
|
||||
activeProviderTurnId,
|
||||
|
|
|
|||
Loading…
Reference in New Issue