@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
package/dist/index.esm.js
CHANGED
|
@@ -4,7 +4,7 @@ import { FirebaseError, generateSHA256Hash, isCloudWorkstation, pingServer } fro
|
|
|
4
4
|
import { Logger } from '@firebase/logger';
|
|
5
5
|
|
|
6
6
|
const name = "@firebase/data-connect";
|
|
7
|
-
const version = "0.7.2-
|
|
7
|
+
const version = "0.7.2-eap-crashlytics.64ada57eb";
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* @license
|
|
@@ -1667,13 +1667,9 @@ const IDLE_CONNECTION_TIMEOUT_MS = 15 * 1000; // 15 seconds
|
|
|
1667
1667
|
/** Initial reconnect delay in ms */
|
|
1668
1668
|
const INITIAL_RECONNECT_DELAY_MS = 1000; // 1 second
|
|
1669
1669
|
/** Max reconnect delay in ms */
|
|
1670
|
-
const MAX_RECONNECT_DELAY_MS =
|
|
1671
|
-
/** Max random jitter to add to reconnect delay in ms */
|
|
1672
|
-
const MAX_RECONNECT_JITTER_MS = 0.5 * 1000; // 0.5 seconds
|
|
1670
|
+
const MAX_RECONNECT_DELAY_MS = 60 * 1000; // 60 seconds
|
|
1673
1671
|
/** Factor to multiply delay by on failure */
|
|
1674
|
-
const RECONNECT_BACKOFF_FACTOR = 1.
|
|
1675
|
-
/** Max number of reconnection attempts before giving up */
|
|
1676
|
-
const MAX_RECONNECT_ATTEMPTS = 10;
|
|
1672
|
+
const RECONNECT_BACKOFF_FACTOR = 1.5;
|
|
1677
1673
|
/**
|
|
1678
1674
|
* The base class for all Stream Transport implementations.
|
|
1679
1675
|
* Handles management of logical streams (requests), authentication, data routing to query layer,
|
|
@@ -1925,15 +1921,10 @@ class AbstractDataConnectStreamTransport extends AbstractDataConnectTransport {
|
|
|
1925
1921
|
if (this.reconnectTimer) {
|
|
1926
1922
|
return;
|
|
1927
1923
|
}
|
|
1928
|
-
|
|
1929
|
-
const errorString = 'Stream disconnected and could not reconnect - max stream reconnection attempts reached.';
|
|
1930
|
-
logError(errorString);
|
|
1931
|
-
void this.cleanupAndTerminate(Code.OTHER, errorString);
|
|
1932
|
-
return;
|
|
1933
|
-
}
|
|
1924
|
+
this.reconnectAttempts++;
|
|
1934
1925
|
const delay = this.reconnectDelayMs;
|
|
1935
1926
|
this.reconnectDelayMs = Math.min(this.reconnectDelayMs * RECONNECT_BACKOFF_FACTOR, MAX_RECONNECT_DELAY_MS);
|
|
1936
|
-
const jitter = Math.random() *
|
|
1927
|
+
const jitter = (Math.random() - 0.5) * delay;
|
|
1937
1928
|
this.reconnectTimer = setTimeout(() => {
|
|
1938
1929
|
this.reconnectTimer = null;
|
|
1939
1930
|
void this.attemptReconnect();
|