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:
1 parent
a63c360539
commit
6b0e8b8f77
1 file changed
+2
-1
+2
-1
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user