From 6b0e8b8f771e53384367dbdace0e1b12303d3e66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B7=E7=94=B5=E8=8A=BD=E8=A1=A3?= Date: Thu, 3 Sep 2026 20:22:34 -0400 Subject: [PATCH] fix: stop retrying non-idempotent requests after a transport error The status guard covered 429 and 5xx, but the catch branch still replayed every method, so a consumed registerWebhook or token rotation could run twice after a lost connection. Claude-Session: https://claude.ai/code/session_01Agoc9bRVE9KL7mmWtey9Vq --- src/client.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/client.ts b/src/client.ts index 52302c8..392a4fd 100644 --- a/src/client.ts +++ b/src/client.ts @@ -361,10 +361,11 @@ export class ElydoraClient { throw err; } - if (attempt < this.maxRetries) { + if (attempt < this.maxRetries && isIdempotent(method)) { await sleep(Math.min(1000 * 2 ** attempt, 10_000)); continue; } + break; } }