Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

docs(engine): say Baileys reports a credential teardown

Yudhi Armyndharis091041933525
diff --git a/src/engine/adapters/baileys-lifecycle.ts b/src/engine/adapters/baileys-lifecycle.ts
index 9ee99cc7f..193199ea2 100644
--- a/src/engine/adapters/baileys-lifecycle.ts
+++ b/src/engine/adapters/baileys-lifecycle.ts
@@ -1049,8 +1049,7 @@ export class BaileysLifecycle {
*
* The status/socket/live-call teardown happens SYNCHRONOUSLY before any await so the session
* watchdog never processes a READY socket that is already dead. The strict auth removal is then
- * awaited as a tracked cleanup (Task 5's onCredentialTeardownStarted registers it under the session
- * NAME). On success the engine reports DISCONNECTED + onDisconnected('logged out'); on failure it
+ * awaited as a tracked cleanup (onCredentialTeardownStarted registers it under the session NAME). On success the engine reports DISCONNECTED + onDisconnected('logged out'); on failure it
* reports FAILED + onError (terminal — a reconnect with known-invalid auth would loop forever).
*/
private async handleRemoteLoggedOut(): Promise<void> {
diff --git a/src/engine/interfaces/whatsapp-engine.interface.ts b/src/engine/interfaces/whatsapp-engine.interface.ts
index d150b2764..49fd01eac 100644
--- a/src/engine/interfaces/whatsapp-engine.interface.ts
+++ b/src/engine/interfaces/whatsapp-engine.interface.ts
@@ -1051,8 +1051,9 @@ export interface EngineEventCallbacks {
* per live row and so covers that directory, so start()/delete()/executeReconnect can wait
* (bounded, fail-closed) for it to settle before touching that path.
*
- * Adapters that never remove credentials on their own (e.g. Baileys until a later task wires its
- * WhatsApp-originated cleanup) simply never invoke this.
+ * Adapters that never remove credentials on their own simply never invoke this. Baileys invokes it for a
+ * WhatsApp-originated unlink (a remote logout): the promise is the cleanup that wipes the stored account
+ * state and the auth directory.
*/
onCredentialTeardownStarted?: (operation: Promise<void>) => void;
/**