Socket snapshot carries the nodes waiting for a machine, so a reconnecting browser restores their queued dots

This commit is contained in:
2026-10-14 23:31:54 +02:00
parent 30fa2b07db
commit d423c47ca6
3 changed files with 34 additions and 0 deletions
@@ -43,6 +43,8 @@ type FlowEvent =
logs?: LogLine[]
/** Emission counts per qualified node. Absent on older instances. */
emits?: Record<string, number>
/** Nodes waiting for a machine. Absent on older instances. */
queued?: { node: string; reason: string; seconds: number }[]
}
| {
type: "message_value"
@@ -275,6 +277,14 @@ function open(url: string) {
// Missing against an instance older than this bundle; the graph
// then starts from zero the way it always did.
liveStore.setEmits(message.emits ?? {})
// `node_queued` is announced once per wait, so a socket that opens
// mid-wait learns of it here or draws the node idle.
for (const entry of message.queued ?? []) {
liveStore.setStatus(entry.node, {
status: "queued",
detail: entry.reason,
})
}
break
case "message_value":
liveStore.setValue(message.name, {