From 71643375fc1ace033bc6d4b2149e81464dab8e05 Mon Sep 17 00:00:00 2001 From: "p.vanderwilt" Date: Thu, 24 Jul 2025 15:09:04 +0200 Subject: [PATCH] Added additional reactor handling --- src/helper/childRegistrationUtils.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/helper/childRegistrationUtils.js b/src/helper/childRegistrationUtils.js index 7b3cbb7..0a2aaac 100644 --- a/src/helper/childRegistrationUtils.js +++ b/src/helper/childRegistrationUtils.js @@ -233,7 +233,18 @@ class ChildRegistrationUtils { this.logger.warn("Invalid reactor provided."); return; } - this.mainClass.upstreamReactor = reactor; // Add reactor to the main class + + // this is poor code, it should be fixed at some point + if (this.mainClass?.upstreamReactor){ + this.mainClass.upstreamReactor = reactor; // Add reactor to the main class + } else { + if (positionVsParent == "downstream") { + this.mainClass.reactors[0] = reactor; + } + if (positionVsParent == "upstream") { + this.mainClass.reactors[1] = reactor; + } + } this.logger.info(`Reactor registered successfully.`); reactor.emitter.on("stateChange", (data) => {