@firebase/data-connect 0.7.2-20260728185501 → 0.7.2-eap-crashlytics.64ada57eb
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.js +5 -14
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +5 -14
- package/dist/index.esm.js.map +1 -1
- package/dist/index.node.cjs.js +5 -14
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/node-esm/index.node.esm.js +5 -14
- package/dist/node-esm/index.node.esm.js.map +1 -1
- package/package.json +7 -7
|
@@ -527,13 +527,9 @@ const IDLE_CONNECTION_TIMEOUT_MS = 15 * 1000; // 15 seconds
|
|
|
527
527
|
/** Initial reconnect delay in ms */
|
|
528
528
|
const INITIAL_RECONNECT_DELAY_MS = 1000; // 1 second
|
|
529
529
|
/** Max reconnect delay in ms */
|
|
530
|
-
const MAX_RECONNECT_DELAY_MS =
|
|
531
|
-
/** Max random jitter to add to reconnect delay in ms */
|
|
532
|
-
const MAX_RECONNECT_JITTER_MS = 0.5 * 1000; // 0.5 seconds
|
|
530
|
+
const MAX_RECONNECT_DELAY_MS = 60 * 1000; // 60 seconds
|
|
533
531
|
/** Factor to multiply delay by on failure */
|
|
534
|
-
const RECONNECT_BACKOFF_FACTOR = 1.
|
|
535
|
-
/** Max number of reconnection attempts before giving up */
|
|
536
|
-
const MAX_RECONNECT_ATTEMPTS = 10;
|
|
532
|
+
const RECONNECT_BACKOFF_FACTOR = 1.5;
|
|
537
533
|
/**
|
|
538
534
|
* The base class for all Stream Transport implementations.
|
|
539
535
|
* Handles management of logical streams (requests), authentication, data routing to query layer,
|
|
@@ -785,15 +781,10 @@ class AbstractDataConnectStreamTransport extends AbstractDataConnectTransport {
|
|
|
785
781
|
if (this.reconnectTimer) {
|
|
786
782
|
return;
|
|
787
783
|
}
|
|
788
|
-
|
|
789
|
-
const errorString = 'Stream disconnected and could not reconnect - max stream reconnection attempts reached.';
|
|
790
|
-
logError(errorString);
|
|
791
|
-
void this.cleanupAndTerminate(Code.OTHER, errorString);
|
|
792
|
-
return;
|
|
793
|
-
}
|
|
784
|
+
this.reconnectAttempts++;
|
|
794
785
|
const delay = this.reconnectDelayMs;
|
|
795
786
|
this.reconnectDelayMs = Math.min(this.reconnectDelayMs * RECONNECT_BACKOFF_FACTOR, MAX_RECONNECT_DELAY_MS);
|
|
796
|
-
const jitter = Math.random() *
|
|
787
|
+
const jitter = (Math.random() - 0.5) * delay;
|
|
797
788
|
this.reconnectTimer = setTimeout(() => {
|
|
798
789
|
this.reconnectTimer = null;
|
|
799
790
|
void this.attemptReconnect();
|
|
@@ -1557,7 +1548,7 @@ class WebSocketTransport extends AbstractDataConnectStreamTransport {
|
|
|
1557
1548
|
}
|
|
1558
1549
|
|
|
1559
1550
|
const name = "@firebase/data-connect";
|
|
1560
|
-
const version = "0.7.2-
|
|
1551
|
+
const version = "0.7.2-eap-crashlytics.64ada57eb";
|
|
1561
1552
|
|
|
1562
1553
|
/**
|
|
1563
1554
|
* @license
|