Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

docs(session): correct delegate counts in unit docblocks

Yudhi Armyndharisc699f2cab16d
diff --git a/src/modules/session/session-engine-leaf-events.ts b/src/modules/session/session-engine-leaf-events.ts
index 150d3908d..1768f6a2e 100644
--- a/src/modules/session/session-engine-leaf-events.ts
+++ b/src/modules/session/session-engine-leaf-events.ts
@@ -21,9 +21,11 @@ const STATUS_SEED_LIMIT = 50;
* constructor. Zero shared state: every method reads only its deps and arguments, so the method
* bodies below moved verbatim, which is why they read `this.sessionRepository` /
* `this.eventsGateway` / `this.webhookService` / `this.configService` / `this.statusStore` /
- * `this.logger` against the same-named fields assigned here. The lifecycle keeps same-named
- * delegates for all three methods (the baileys forwarder precedent), so every existing call site
- * stays byte-identical.
+ * `this.logger` against the same-named fields assigned here. The lifecycle keeps a same-named
+ * delegate only for `seedStatuses` — the one method its own core calls (the baileys forwarder
+ * precedent) — so that call site stays byte-identical. `dispatchGroupEvent` and
+ * `maybeAutoRejectCall` are reached by the event wiring through `host.leafEvents` directly and
+ * have no lifecycle delegate.
*/
export class SessionEngineLeafEvents {
private readonly sessionRepository: Repository<Session>;
diff --git a/src/modules/session/session-lifecycle-fences.ts b/src/modules/session/session-lifecycle-fences.ts
index 7f8ad07ae..200ea8eb6 100644
--- a/src/modules/session/session-lifecycle-fences.ts
+++ b/src/modules/session/session-lifecycle-fences.ts
@@ -10,10 +10,13 @@ import { type createLogger } from '../../common/services/logger.service';
* reference, so this unit and the lifecycle (and every spec poking the maps through the lifecycle)
* always observe the same instances; method bodies below moved verbatim, which is why they read
* `this.pendingTeardowns` / `this.pendingInitialStatuses` / `this.engines` / `this.logger` against
- * the same-named fields assigned here. The lifecycle keeps same-named delegates for all six
- * methods (the baileys forwarder precedent), so every existing call site and spec poke
- * (`trackPendingCredentialTeardown` is invoked by name in logout-teardown-race.spec) stays
- * byte-identical.
+ * the same-named fields assigned here. The lifecycle keeps same-named delegates for the four
+ * methods its own core still calls — `teardownEngineSafely`, `trackPendingCredentialTeardown`,
+ * `awaitPendingTeardown`, `evictAndForceDestroy` (the baileys forwarder precedent) — so every
+ * existing call site and spec poke (`trackPendingCredentialTeardown` is invoked by name in
+ * logout-teardown-race.spec) stays byte-identical. The other two methods,
+ * `destroyEngineSafely` and `awaitInitialStatus`, are reached by the controls unit through this
+ * instance directly (`this.fences.…`) and have no lifecycle delegate.
*/
export class SessionLifecycleFences {
private readonly engines: EngineRegistry;