@relai-team/access-sdk 0.12.3 → 0.12.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.cjs CHANGED
@@ -171,7 +171,12 @@ var HttpClient = class {
171
171
  await sleep(retryDelayMs(res, i));
172
172
  continue;
173
173
  }
174
- throw await this.toApiError(res);
174
+ const apiErr = await this.toApiError(res);
175
+ if (apiErr.code === "idempotency_in_progress" && i < this.cfg.maxRetries) {
176
+ await sleep(retryDelayMs(res, i));
177
+ continue;
178
+ }
179
+ throw apiErr;
175
180
  }
176
181
  throw lastErr instanceof Error ? lastErr : new exports.RelaiError("Request failed");
177
182
  }
package/dist/index.js CHANGED
@@ -55,7 +55,12 @@ var HttpClient = class {
55
55
  await sleep(retryDelayMs(res, i));
56
56
  continue;
57
57
  }
58
- throw await this.toApiError(res);
58
+ const apiErr = await this.toApiError(res);
59
+ if (apiErr.code === "idempotency_in_progress" && i < this.cfg.maxRetries) {
60
+ await sleep(retryDelayMs(res, i));
61
+ continue;
62
+ }
63
+ throw apiErr;
59
64
  }
60
65
  throw lastErr instanceof Error ? lastErr : new RelaiError("Request failed");
61
66
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@relai-team/access-sdk",
3
- "version": "0.12.3",
3
+ "version": "0.12.4",
4
4
  "description": "Official Relai Access SDK, open Relai Exchange Zone nodes over BLE, backed by the Relai Access platform (server-owns-trust).",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "type": "module",