Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

docs(sdk): match the pacing 429 wording in the SDK READMEs

Yudhi Armyndharis9e348dd76210
diff --git a/sdk/go/README.md b/sdk/go/README.md
index 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 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);
`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: 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
diff --git a/sdk/go/errors.go b/sdk/go/errors.go
index 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.go
index 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.md
index 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 webhooks
diff --git a/sdk/java/src/main/java/com/rmyndharis/openwa/errors/OpenWARateLimitError.java b/sdk/java/src/main/java/com/rmyndharis/openwa/errors/OpenWARateLimitError.java
index 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.md
index 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 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. 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 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
diff --git a/sdk/javascript/src/errors.ts b/sdk/javascript/src/errors.ts
index 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.md
index 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 `OpenWATimeo
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 `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 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
diff --git a/sdk/php/src/Exceptions/OpenWARateLimitException.php b/sdk/php/src/Exceptions/OpenWARateLimitException.php
index 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.md
index 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 per
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 `.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 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
diff --git a/sdk/python/openwa/errors.py b/sdk/python/openwa/errors.py
index 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 the
per-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.
"""