Free, Open Source, Self-Hosted WhatsApp API Gateway
TypeScript apibotgatewayself-hostedwhatsappwhatsapp-apiwhatsapp-automationwhatsapp-botwhatsapp-gatewaywhatsapp-gateway-apiwhatsapp-webwhatsapp-web-api
docs(sdk): match the pacing 429 wording in the SDK READMEs
Yudhi Armyndharis9e348dd76210
diff --git a/sdk/go/README.md b/sdk/go/README.mdindex bbb8f4d84..35cefa45a 100644--- a/sdk/go/README.md+++ b/sdk/go/README.md@@ -124,9 +124,10 @@ because WhatsApp may never answer that query, so bound any retry. A 429 fromthe global rate limiter lifts when its window expires (seconds for theper-second tier, up to an hour for the hourly tier by default);`APIError.RetryAfter` carries its `Retry-After` header, which `WithRetry` also-honors. A 429 whose `APIError.Code` is `"SEND_PACING_LIMITED"` is not transient:-do not retry it before `RetryAfter`, which then comes from the body and can be-hours. `APIError.Header` holds the response headers. A timeout surfaces as+honors. A 429 whose `APIError.Code` is `"SEND_PACING_LIMITED"` is usually not+transient: do not retry it before `RetryAfter`, which then comes from the body:+a few seconds when only sends still in flight caused it, otherwise up to the+next UTC day. `APIError.Header` holds the response headers. A timeout surfaces as`*openwa.TimeoutError`. A 503 does not prove a write was never carried out: theengine answers it when WhatsApp did not confirm in time, and the change may stillhave been applied, so re-read the state before repeating it. In a routeddiff --git a/sdk/go/errors.go b/sdk/go/errors.goindex d91eb52ae..56f38ffcd 100644--- a/sdk/go/errors.go+++ b/sdk/go/errors.go@@ -35,8 +35,9 @@ var (// limiter's 429 lifts when its window expires (seconds for the per-second// tier, up to an hour for the hourly tier by default); APIError.RetryAfter// carries its Retry-After header, which WithRetry also honors. A 429 whose- // Code is "SEND_PACING_LIMITED" is not transient: do not retry it before- // RetryAfter, which then comes from the body and can be hours.+ // Code is "SEND_PACING_LIMITED" is usually not transient: do not retry it+ // before RetryAfter, which then comes from the body: a few seconds when+ // only sends still in flight caused it, otherwise up to the next UTC day.ErrRateLimited = errors.New("openwa: rate limited")// ErrNotImplemented is returned for a 501 (the active engine does not// support this operation).diff --git a/sdk/go/retry.go b/sdk/go/retry.goindex 5729dec8b..e7775451a 100644--- a/sdk/go/retry.go+++ b/sdk/go/retry.go@@ -216,7 +216,7 @@ func retryMiddleware(p RetryPolicy, log Logger) Middleware {// the request before acting on it. A 500/502/504 can arrive// after the gateway already sent the message, so replaying// a POST on those would double-send. A send-pacing 429 is- // not transient, so it goes back to the caller.+ // usually not transient, so it goes back to the caller.retryable = retryableForMethod(req.Method, resp.StatusCode) &&attempt < p.MaxRetries && !isSendPacingRefusal(resp)}diff --git a/sdk/java/README.md b/sdk/java/README.mdindex e44a88591..f006bd90b 100644--- a/sdk/java/README.md+++ b/sdk/java/README.md@@ -135,7 +135,7 @@ try {| `OpenWAApiError` | — | Any other non-2xx (carries `.status()`) || `OpenWATimeoutError` | — | Request exceeded the configured timeout |-All extend `OpenWAError` (a `RuntimeException`). 503 is transient, but a catalog 503 can persist because WhatsApp may never answer that query, so bound any retry. A 429 from the global rate limiter lifts when its window expires (seconds for the per-second tier, up to an hour for the hourly tier by default), and `retryAfterSeconds()` carries its `Retry-After` header. A 429 whose `code()` is `"SEND_PACING_LIMITED"` is not transient: do not retry it before `retryAfterSeconds()`, which then comes from the body and can be hours. `headers()` returns the response headers. A 503 does not prove a write was never carried out: the engine answers it when WhatsApp did not confirm in time, and the change may still have been applied, so re-read the state before repeating it. In a routed deployment a forward that fails before reaching the owner node answers 503, one that fails after the request reached it answers 502 or 504, and a 503 from the owner itself is relayed unchanged.+All extend `OpenWAError` (a `RuntimeException`). 503 is transient, but a catalog 503 can persist because WhatsApp may never answer that query, so bound any retry. A 429 from the global rate limiter lifts when its window expires (seconds for the per-second tier, up to an hour for the hourly tier by default), and `retryAfterSeconds()` carries its `Retry-After` header. A 429 whose `code()` is `"SEND_PACING_LIMITED"` is usually not transient: do not retry it before `retryAfterSeconds()`, which then comes from the body: a few seconds when only sends still in flight caused it, otherwise up to the next UTC day. `headers()` returns the response headers. A 503 does not prove a write was never carried out: the engine answers it when WhatsApp did not confirm in time, and the change may still have been applied, so re-read the state before repeating it. In a routed deployment a forward that fails before reaching the owner node answers 503, one that fails after the request reached it answers 502 or 504, and a 503 from the owner itself is relayed unchanged.## Receiving webhooksdiff --git a/sdk/java/src/main/java/com/rmyndharis/openwa/errors/OpenWARateLimitError.java b/sdk/java/src/main/java/com/rmyndharis/openwa/errors/OpenWARateLimitError.javaindex d295a554b..90e75abcd 100644--- a/sdk/java/src/main/java/com/rmyndharis/openwa/errors/OpenWARateLimitError.java+++ b/sdk/java/src/main/java/com/rmyndharis/openwa/errors/OpenWARateLimitError.java@@ -8,9 +8,10 @@ import java.util.Map;** <p>The global rate limiter's 429 lifts when its window expires (seconds for the per-second tier,* up to an hour for the hourly tier by default), and {@link #retryAfterSeconds()} carries its- * {@code Retry-After} header. A 429 whose {@link #code()} is {@code "SEND_PACING_LIMITED"} is not- * transient: do not retry it before {@link #retryAfterSeconds()}, which then comes from the body and- * can be hours.+ * {@code Retry-After} header. A 429 whose {@link #code()} is {@code "SEND_PACING_LIMITED"} is+ * usually not transient: do not retry it before {@link #retryAfterSeconds()}, which then comes from+ * the body: a few seconds when only sends still in flight caused it, otherwise up to the next UTC+ * day.*/public class OpenWARateLimitError extends OpenWAApiError {public OpenWARateLimitError(String message, int status, Object body, String errorKind) {diff --git a/sdk/javascript/README.md b/sdk/javascript/README.mdindex 80f69d50f..ca2064612 100644--- a/sdk/javascript/README.md+++ b/sdk/javascript/README.md@@ -65,9 +65,10 @@ catalog 503 can persist because WhatsApp may never answer that query, so boundany retry. A 429 from the global rate limiter lifts when its window expires(seconds for the per-second tier, up to an hour for the hourly tier bydefault), and `.retryAfterSeconds` carries its `Retry-After` header. A 429 whose-`.code` is `"SEND_PACING_LIMITED"` is not transient: do not retry it before-`.retryAfterSeconds`, which then comes from the body and can be hours. Every API-error also exposes the response `.headers`. A 503 does not prove a write was+`.code` is `"SEND_PACING_LIMITED"` is usually not transient: do not retry it+before `.retryAfterSeconds`, which then comes from the body: a few seconds when+only sends still in flight caused it, otherwise up to the next UTC day. Every+API error also exposes the response `.headers`. A 503 does not prove a write wasnever carried out: the engine answers it when WhatsApp did not confirm in time,and the change may still have been applied, so re-read the state beforerepeating it. In a routed deployment a forward that fails before reaching thediff --git a/sdk/javascript/src/errors.ts b/sdk/javascript/src/errors.tsindex b72cf1457..73230121d 100644--- a/sdk/javascript/src/errors.ts+++ b/sdk/javascript/src/errors.ts@@ -101,8 +101,8 @@ export class OpenWAConflictError extends OpenWAApiError {}* 429 Too Many Requests: rate limited. The global rate limiter's 429 lifts when its window* expires (seconds for the per-second tier, up to an hour for the hourly tier by default), and* `retryAfterSeconds` carries its `Retry-After` header. A 429 with `code: 'SEND_PACING_LIMITED'` is- * not transient: do not retry it before `retryAfterSeconds`, which then comes from the body and can- * be hours.+ * usually not transient: do not retry it before `retryAfterSeconds`, which then comes from the body:+ * a few seconds when only sends still in flight caused it, otherwise up to the next UTC day.*/export class OpenWARateLimitError extends OpenWAApiError {}/** 501 Not Implemented — the active engine does not support this operation. */diff --git a/sdk/php/README.md b/sdk/php/README.mdindex 41426fd1e..036c13f8c 100644--- a/sdk/php/README.md+++ b/sdk/php/README.md@@ -73,9 +73,10 @@ exposing `getStatus()` and the parsed `getBody()`. A timeout throws `OpenWATimeo503 is transient, but a catalog 503 can persist because WhatsApp may never answer that query,so bound any retry. A 429 from the global rate limiter lifts when its window expires (seconds forthe per-second tier, up to an hour for the hourly tier by default), and `getRetryAfterSeconds()`-carries its `Retry-After` header. A 429 whose `getErrorCode()` is `"SEND_PACING_LIMITED"` is not-transient: do not retry it before `getRetryAfterSeconds()`, which then comes from the body and can-be hours. `getHeaders()` returns the response headers. A 503 does not prove a write was never+carries its `Retry-After` header. A 429 whose `getErrorCode()` is `"SEND_PACING_LIMITED"` is usually+not transient: do not retry it before `getRetryAfterSeconds()`, which then comes from the body: a+few seconds when only sends still in flight caused it, otherwise up to the next UTC day.+`getHeaders()` returns the response headers. A 503 does not prove a write was nevercarried out: the engine answers it when WhatsApp did not confirm in time, and the change may stillhave been applied, so re-read the state before repeating it. In a routed deployment a forward thatfails before reaching the owner node answers 503, one that fails after the request reached it answersdiff --git a/sdk/php/src/Exceptions/OpenWARateLimitException.php b/sdk/php/src/Exceptions/OpenWARateLimitException.phpindex f1150da55..f95cb9e28 100644--- a/sdk/php/src/Exceptions/OpenWARateLimitException.php+++ b/sdk/php/src/Exceptions/OpenWARateLimitException.php@@ -10,8 +10,10 @@ namespace OpenWA\Exceptions;* The global rate limiter's 429 lifts when its window expires (seconds for the* per-second tier, up to an hour for the hourly tier by default), and* getRetryAfterSeconds() carries its Retry-After header. A 429 whose- * getErrorCode() is "SEND_PACING_LIMITED" is not transient: do not retry it- * before getRetryAfterSeconds(), which then comes from the body and can be hours.+ * getErrorCode() is "SEND_PACING_LIMITED" is usually not transient: do not+ * retry it before getRetryAfterSeconds(), which then comes from the body: a few+ * seconds when only sends still in flight caused it, otherwise up to the next+ * UTC day.*/class OpenWARateLimitException extends OpenWAApiException{diff --git a/sdk/python/README.md b/sdk/python/README.mdindex ab908e857..98367872e 100644--- a/sdk/python/README.md+++ b/sdk/python/README.md@@ -88,9 +88,10 @@ timeout raises `OpenWATimeoutError`. 503 is transient, but a catalog 503 can perWhatsApp may never answer that query, so bound any retry. A 429 from the global rate limiterlifts when its window expires (seconds for the per-second tier, up to an hour for the hourlytier by default), and `.retry_after_seconds` carries its `Retry-After` header. A 429 whose-`.code` is `"SEND_PACING_LIMITED"` is not transient: do not retry it before-`.retry_after_seconds`, which then comes from the body and can be hours. Every API error also-exposes the response `.headers`. A 503 does not prove a write was never carried out: the engine+`.code` is `"SEND_PACING_LIMITED"` is usually not transient: do not retry it before+`.retry_after_seconds`, which then comes from the body: a few seconds when only sends still in+flight caused it, otherwise up to the next UTC day. Every API error also exposes the response+`.headers`. A 503 does not prove a write was never carried out: the engineanswers it when WhatsApp did not confirm in time, and the change may still have been applied, sore-read the state before repeating it. In a routed deployment a forward that fails before reachingthe owner node answers 503, one that fails after the request reached it answers 502 or 504, and adiff --git a/sdk/python/openwa/errors.py b/sdk/python/openwa/errors.pyindex 4e12da3f7..0edc45762 100644--- a/sdk/python/openwa/errors.py+++ b/sdk/python/openwa/errors.py@@ -105,8 +105,10 @@ class OpenWARateLimitError(OpenWAApiError):The global rate limiter's 429 lifts when its window expires (seconds for theper-second tier, up to an hour for the hourly tier by default), and``retry_after_seconds`` carries its Retry-After header. A 429 with code- "SEND_PACING_LIMITED" is not transient: do not retry it before- ``retry_after_seconds``, which then comes from the body and can be hours.+ "SEND_PACING_LIMITED" is usually not transient: do not retry it before+ ``retry_after_seconds``, which then comes from the body: a few seconds+ when only sends still in flight caused it, otherwise up to the next UTC+ day."""