fix(runtime): isolate channel messages by target
This commit is contained in:
@@ -754,6 +754,16 @@ export class LineUpRuntime {
|
||||
runtimeLog("message.ignored", { stage: "sender" });
|
||||
return;
|
||||
}
|
||||
// The AppServer channel is shared by several users. Agent envelopes carry
|
||||
// the intended human target; discard another user's message before scope
|
||||
// validation so it is not reported as a malformed message for this user.
|
||||
const parsedEnvelope = parseEnvelopeJSON(payload);
|
||||
if (parsedEnvelope.ok
|
||||
&& parsedEnvelope.envelope.target?.kind === "human"
|
||||
&& parsedEnvelope.envelope.target.id !== this.session.uid) {
|
||||
runtimeLog("message.ignored", { stage: "target" });
|
||||
return;
|
||||
}
|
||||
if (message.from_uid === this.session.uid) {
|
||||
const own = parseEnvelopeJSON(payload);
|
||||
if (own.ok && CONTROL_ECHO_TYPES.has(own.envelope.type)) return;
|
||||
|
||||
Reference in New Issue
Block a user