web: live run updates over a single app-wide watch (R10)

This commit is contained in:
2026-10-19 14:22:53 +01:00
parent 2fe63012f9
commit 21a6ee3c4d
13 changed files with 1580 additions and 90 deletions
+20
View File
@@ -118,6 +118,26 @@ export class PipelinesClient extends EventTarget {
return run;
}
/**
* Sends one request without awaiting a reply, returning the generated id
* (mirrors the Android `PipelinesClient.sendOnly`). Used for the run-event
* watch: `subscribe` may never be acknowledged, so registering a pending entry
* would leave it to time out, and `unsubscribe` has nothing to read back.
*
* The send is synchronous so back-to-back frames (`unsubscribe` then
* `subscribe`) keep their order on the wire; the id is still available so a
* server that does ack (or refuses) has its reply surface as an unsolicited
* `frame` event with that id. A call before the socket is connected is refused
* with `NotConnectedError`, exactly like `call`.
*/
sendOnly(request) {
const socket = this.#ws;
if (!socket || this.#state.kind !== CONNECTED) throw new NotConnectedError();
const id = `web-${++this.#seq}`;
socket.send(JSON.stringify({ ...request, id }));
return id;
}
async #doCall(request) {
const socket = this.#ws;
if (!socket || this.#state.kind !== CONNECTED) throw new NotConnectedError();