fix: add tests that check some of the issues are already fixed (#905)

* Add tests that check some of the issues are already fixed

* Fix test formatting
This commit is contained in:
Sergey Mankovsky
2026-03-10 17:58:53 +01:00
committed by GitHub
parent 22a50bb94d
commit b53c8da398
7 changed files with 158 additions and 3 deletions

View File

@@ -0,0 +1,10 @@
/** Reconnection policy for WebSocket: exponential backoff, capped at 30s. */
export const MAX_RETRIES = 10;
/**
* Delay in ms before reconnecting. retryIndex is 0-based (0 = first retry).
* Returns 1000, 2000, 4000, ... up to 30000 max.
*/
export function getReconnectDelayMs(retryIndex: number): number {
return Math.min(1000 * Math.pow(2, retryIndex), 30000);
}