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
This commit is contained in:
雷电芽衣 committed 2026-09-03 20:22:34 -04:00
1 parent a63c360539
commit 6b0e8b8f77
1 file changed
+2 -1
+2 -1
View File
@@ -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;
}
}