@spacelr/sdk 0.19.3 → 0.19.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -577,16 +577,20 @@ var TokenManager = class {
577
577
  * gateway) surfaced as `SpacelrNetworkError`/`SpacelrTimeoutError` (#759);
578
578
  * - a 5xx server response — e.g. a 503 the gateway returns when oauth-service
579
579
  * is momentarily down (#760/#762) — which is retryable infrastructure, not
580
- * a token rejection.
581
- * A real auth rejection (401/invalid_grant) or any other non-5xx server error
582
- * is NOT transient and is treated as a server-confirmed loss.
580
+ * a token rejection;
581
+ * - a 429 or 408 (#1080) — the rate limit is per IP, so it is shared by
582
+ * everyone behind one NAT, and a 408 never completed. Neither judged the
583
+ * refresh token.
584
+ * A real auth rejection (401/invalid_grant) or any other 4xx server error is
585
+ * NOT transient and is treated as a server-confirmed loss.
583
586
  */
584
587
  isTransientTransportError(error) {
585
588
  if (error instanceof SpacelrNetworkError || error instanceof SpacelrTimeoutError) {
586
589
  return true;
587
590
  }
588
591
  if (error instanceof SpacelrError && typeof error.statusCode === "number") {
589
- return error.statusCode >= 500 && error.statusCode <= 599;
592
+ const status = error.statusCode;
593
+ return status === 429 || status === 408 || status >= 500 && status <= 599;
590
594
  }
591
595
  return false;
592
596
  }