EventBus: prevent backflow of messages that originate from CommsServer back into CommsServer

This commit is contained in:
Tamius Han 2025-05-07 00:42:25 +02:00
parent cff1d3cf16
commit 14f837d1f0

View File

@ -94,7 +94,9 @@ export default class EventBus {
// preventing messages from flowing back to their original senders is
// CommsServer's job. EventBus does not have enough data for this decision.
if (this.comms) {
// We do, however, have enough data to prevent backflow of messages that
// crossed CommsServer once already.
if (this.comms && context?.origin !== CommsOrigin.Server) {
this.comms.sendMessage({command, config: commandData, context}, context);
}