Merge branch 'main' into web-chat-composer
# Conflicts: # web/src/app.js # web/src/client.js # web/src/protocol.js # web/test/chat.test.mjs # web/test/repository.test.mjs # web/test/ui-smoke.mjs
This commit is contained in:
+9
-6
@@ -1,7 +1,9 @@
|
||||
// A single, reused WebSocket connection to /connect, mirroring
|
||||
// android/.../data/transport/PipelinesClient.kt: requests are serialized, each
|
||||
// carries a client-generated stable id, replies are matched by id, and
|
||||
// unsolicited envelopes are dropped. There is no authentication of any kind.
|
||||
// carries a client-generated stable id, replies are matched by id, and an
|
||||
// unsolicited envelope is surfaced as a DOM-free `frame` event (the app folds the
|
||||
// frames it cares about) rather than misattributed to a request. There is no
|
||||
// authentication of any kind.
|
||||
//
|
||||
// DOM-free on purpose: the browser app and the Node smoke test share this exact
|
||||
// module, so the smoke test exercises the real client, not a re-implementation.
|
||||
@@ -186,10 +188,11 @@ export class PipelinesClient extends EventTarget {
|
||||
entry.resolve(message);
|
||||
return;
|
||||
}
|
||||
// Unsolicited envelope: a server push (a `chat_event` frame, a pushed
|
||||
// `run_event`, or the connection's initial `pipeline_list`). It has no
|
||||
// matching request, so it is surfaced to listeners as a `frame` event for a
|
||||
// view to fold; with no listener it is simply dropped, exactly as before.
|
||||
// No pending request matches: the envelope is unsolicited — the connection's
|
||||
// initial `pipeline_list`, or a server push such as a `chat_event` frame or a
|
||||
// `run_event` — and is surfaced as a DOM-free `frame` event for a view to fold;
|
||||
// with no listener it is simply dropped. It is never misattributed to a
|
||||
// request, which is still matched by id.
|
||||
this.dispatchEvent(new CustomEvent("frame", { detail: message }));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user