Free, Open Source, Self-Hosted WhatsApp API Gateway
TypeScript apibotgatewayself-hostedwhatsappwhatsapp-apiwhatsapp-automationwhatsapp-botwhatsapp-gatewaywhatsapp-gateway-apiwhatsapp-webwhatsapp-web-api
docs(sdk): describe engineLoaded on a multi-node gateway
Yudhi Armyndharisf72277dcd15a
diff --git a/sdk/go/types_session.go b/sdk/go/types_session.goindex dc0eb1b88..c3f437ed4 100644--- a/sdk/go/types_session.go+++ b/sdk/go/types_session.go@@ -161,11 +161,15 @@ type SessionResponse struct {// Restriction reports a limit WhatsApp itself has placed on the account, or nil when there is// none. Distinct from LastError, which describes a fault on the gateway's side.Restriction *AccountRestriction `json:"restriction,omitempty"`- // EngineLoaded reports whether the gateway holds a live engine for this session -- the- // precondition stop/logout/force-kill require and start refuses. Not derivable from Status:- // "disconnected" covers both a session mid automatic-reconnect (engine present) and one stopped- // with no engine. A gateway that predates the field omits it, which decodes as false; against- // such a gateway false does not mean no engine is loaded, so fall back to Status.+ // EngineLoaded reports whether the gateway holds a live engine for this session: an engine in+ // the answering process or, in a multi-node deployment, a live claim by the node running it. On+ // the node running the session, true means stop/logout/force-kill can act and start is refused.+ // For a session another node runs, those routes act only when request routing (NODE_URL on+ // every node) forwards them; without it, other nodes answer 409 to start and stop and 400 to+ // logout and force-kill. Not derivable from Status: "disconnected" covers both a session mid+ // automatic-reconnect (engine present) and one stopped with no engine. A gateway that predates+ // the field omits it, which decodes as false; against such a gateway false does not mean no+ // engine is loaded, so fall back to Status.EngineLoaded bool `json:"engineLoaded"`}diff --git a/sdk/java/src/main/java/com/rmyndharis/openwa/model/SessionResponse.java b/sdk/java/src/main/java/com/rmyndharis/openwa/model/SessionResponse.javaindex f3475d93e..39eaf5803 100644--- a/sdk/java/src/main/java/com/rmyndharis/openwa/model/SessionResponse.java+++ b/sdk/java/src/main/java/com/rmyndharis/openwa/model/SessionResponse.java@@ -19,9 +19,14 @@ public record SessionResponse(*/AccountRestriction restriction,/**- * Whether the gateway holds a live engine for this session. The precondition the lifecycle- * routes enforce; not derivable from {@code status}, since {@code DISCONNECTED} covers both a- * session mid automatic-reconnect (engine present) and one stopped with no engine. {@code null}- * from a gateway older than the field.+ * Whether the gateway holds a live engine for this session: an engine in the answering process+ * or, in a multi-node deployment, a live claim by the node running it. On the node running the+ * session, {@code true} means {@code stop}, {@code logout} and {@code force-kill} can act and+ * {@code start} is refused. For a session another node runs, those routes act only when request+ * routing ({@code NODE_URL} on every node) forwards them; without it, other nodes answer 409 to+ * {@code start} and {@code stop} and 400 to {@code logout} and {@code force-kill}. Not+ * derivable from {@code status}, since {@code DISCONNECTED} covers both a session mid+ * automatic-reconnect (engine present) and one stopped with no engine. {@code null} from a+ * gateway older than the field.*/Boolean engineLoaded) {}diff --git a/sdk/javascript/src/types.ts b/sdk/javascript/src/types.tsindex b051e6df9..647c3e335 100644--- a/sdk/javascript/src/types.ts+++ b/sdk/javascript/src/types.ts@@ -74,10 +74,14 @@ export interface SessionResponse {*/restriction?: AccountRestriction | null;/**- * Whether the gateway holds a live engine for this session right now — the precondition `stop`,- * `logout` and `force-kill` require and `start` refuses. Not derivable from `status`:- * `disconnected` covers both a session mid automatic-reconnect (engine present) and one stopped- * with no engine. Absent from a gateway that predates the field.+ * Whether the gateway holds a live engine for this session: an engine in the answering process+ * or, in a multi-node deployment, a live claim by the node running it. On the node running the+ * session, `true` means `stop`, `logout` and `force-kill` can act and `start` is refused. For a+ * session another node runs, those routes act only when request routing (`NODE_URL` on every+ * node) forwards them; without it, other nodes answer 409 to `start` and `stop` and 400 to+ * `logout` and `force-kill`. Not derivable from `status`: `disconnected` covers both a session+ * mid automatic-reconnect (engine present) and one stopped with no engine. Absent from a gateway+ * that predates the field.*/engineLoaded: boolean;}diff --git a/sdk/python/openwa/types.py b/sdk/python/openwa/types.pyindex ff6bdd35f..cc7440df6 100644--- a/sdk/python/openwa/types.py+++ b/sdk/python/openwa/types.py@@ -246,10 +246,14 @@ class SessionResponse(TypedDict):# A limit WhatsApp itself has placed on the account, or None when there is none. Distinct from# lastError, which describes a fault on the gateway's side.restriction: NotRequired[AccountRestriction | None]- # Whether the gateway holds a live engine for this session -- the precondition stop/logout/- # force-kill require and start refuses. Not derivable from status: 'disconnected' covers both a- # session mid automatic-reconnect (engine present) and one stopped with no engine. Absent from a- # gateway that predates the field (the TypedDict is total=False).+ # Whether the gateway holds a live engine for this session: an engine in the answering process+ # or, in a multi-node deployment, a live claim by the node running it. On the node running the+ # session, True means stop/logout/force-kill can act and start is refused. For a session another+ # node runs, those routes act only when request routing (NODE_URL on every node) forwards them;+ # without it, other nodes answer 409 to start and stop and 400 to logout and force-kill. Not+ # derivable from status: 'disconnected' covers both a session mid automatic-reconnect (engine+ # present) and one stopped with no engine. Absent from a gateway that predates the field (the+ # TypedDict is total=False).engineLoaded: bool