fix(web): keep queued threads subscribed (#15293)
Co-authored-by: maria <[email protected]>
This commit is contained in:
1 parent
b8d03ba2dd
commit
4a90c1cf5d
2 files changed
+8
-2
No files matched your search
@@ -19,7 +19,7 @@ import { createRunningThreadKeepAliveAtom } from "./threads";
|
||||
const LOCAL = EnvironmentId.make("local");
|
||||
const REMOTE = EnvironmentId.make("remote");
|
||||
|
||||
type Status = "running" | "starting" | "idle";
|
||||
type Status = "running" | "starting" | "preparing" | "queued" | "waiting" | "idle";
|
||||
function shell(id: string, status: Status | null) {
|
||||
return { id: ThreadId.make(id), status: status ?? "idle" } satisfies Pick<
|
||||
OrchestrationV2ThreadShell,
|
||||
@@ -159,6 +159,12 @@ describe("createRunningThreadKeepAliveAtom", () => {
|
||||
expect(h.openStreams()).toEqual([]);
|
||||
});
|
||||
|
||||
it("keeps queued threads open", () => {
|
||||
const h = makeHarness();
|
||||
h.registry.set(h.threads(LOCAL), [shell("a", "queued")]);
|
||||
expect(h.openStreams()).toEqual(["local:a"]);
|
||||
});
|
||||
|
||||
it("follows environments that connect and go away", () => {
|
||||
const h = makeHarness();
|
||||
h.registry.set(h.environmentIds, [LOCAL]);
|
||||
|
||||
@@ -51,7 +51,7 @@ export function useEnvironmentThread(
|
||||
}
|
||||
|
||||
const isRunning = (status: string) =>
|
||||
status === "preparing" || status === "starting" || status === "running";
|
||||
status === "preparing" || status === "queued" || status === "starting" || status === "running";
|
||||
|
||||
type KeptThreads = ReadonlyMap<EnvironmentId, ReadonlySet<ThreadId>>;
|
||||
|
||||
|
||||
Reference in new issue
Block a user