@telecrypt-io/storage 0.5.28 → 0.5.30

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.
@@ -1,3 +1,6 @@
1
+ export declare class ConditionTimeoutError extends Error {
2
+ constructor(timeoutMs: number);
3
+ }
1
4
  /**
2
5
  * A freshly-synced client doesn't always see a room/event the *instant* the
3
6
  * server has committed it — e.g. a room this same session just created can
package/dist/core/poll.js CHANGED
@@ -1,3 +1,9 @@
1
+ export class ConditionTimeoutError extends Error {
2
+ constructor(timeoutMs) {
3
+ super(`timed out after ${timeoutMs}ms waiting for condition`);
4
+ this.name = "ConditionTimeoutError";
5
+ }
6
+ }
1
7
  /**
2
8
  * A freshly-synced client doesn't always see a room/event the *instant* the
3
9
  * server has committed it — e.g. a room this same session just created can
@@ -12,7 +18,7 @@ export async function waitForCondition(check, opts) {
12
18
  const timeoutMs = opts?.timeoutMs ?? 15000;
13
19
  const intervalMs = opts?.intervalMs ?? 300;
14
20
  const deadline = Date.now() + timeoutMs;
15
- const timeoutError = () => new Error(`timed out after ${timeoutMs}ms waiting for condition`);
21
+ const timeoutError = () => new ConditionTimeoutError(timeoutMs);
16
22
  const abortError = () => {
17
23
  const reason = opts?.signal?.reason;
18
24
  return reason instanceof Error ? reason : new Error("condition wait aborted");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telecrypt-io/storage",
3
- "version": "0.5.28",
3
+ "version": "0.5.30",
4
4
  "license": "BUSL-1.1",
5
5
  "type": "module",
6
6
  "packageManager": "npm@11.19.0",