lunibee 0.3.2 → 0.3.3

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.
@@ -2,7 +2,7 @@
2
2
  // packages/rest/package.json
3
3
  var package_default = {
4
4
  name: "@lunibee/rest",
5
- version: "0.3.2",
5
+ version: "0.3.3",
6
6
  type: "module",
7
7
  module: "./src/index.ts",
8
8
  types: "./src/index.ts",
@@ -1336,6 +1336,7 @@ class RedisRateLimitStore {
1336
1336
  #atomic;
1337
1337
  #local = new MemoryRateLimitStore;
1338
1338
  #lastError;
1339
+ #warnedSlots = false;
1339
1340
  #lastFailureAt;
1340
1341
  #failures = 0;
1341
1342
  #mode;
@@ -1434,6 +1435,10 @@ class RedisRateLimitStore {
1434
1435
  this.#lastError = error;
1435
1436
  this.#lastFailureAt = Date.now();
1436
1437
  this.#failures++;
1438
+ if (!this.#warnedSlots && /CROSSSLOT/.test(String(error))) {
1439
+ this.#warnedSlots = true;
1440
+ console.warn('[lunibee/rest] Redis Cluster refused a script whose keys hash to different slots (CROSSSLOT): use a hash-tagged prefix such as "{mybot}:rest:".');
1441
+ }
1437
1442
  try {
1438
1443
  this.#onErrorCallback?.(operation, error);
1439
1444
  } catch {}
@@ -2180,4 +2185,4 @@ export {
2180
2185
  tokenFingerprint
2181
2186
  };
2182
2187
 
2183
- //# debugId=8464D7D05D07B1F864756E2164756E21
2188
+ //# debugId=94C16174A190B15864756E2164756E21