@firebase/data-connect 0.7.1 → 0.7.2-eap-crashlytics.e21972d2a
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 +8 -16
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +8 -16
- package/dist/index.esm.js.map +1 -1
- package/dist/index.node.cjs.js +8 -16
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/node-esm/index.node.esm.js +8 -16
- package/dist/node-esm/index.node.esm.js.map +1 -1
- package/package.json +12 -12
|
@@ -523,17 +523,13 @@ class RESTTransport extends AbstractDataConnectTransport {
|
|
|
523
523
|
/** The Request ID of the first request over the stream */
|
|
524
524
|
const FIRST_REQUEST_ID = 1;
|
|
525
525
|
/** Time to wait before closing an idle connection (no active subscriptions). */
|
|
526
|
-
const IDLE_CONNECTION_TIMEOUT_MS =
|
|
526
|
+
const IDLE_CONNECTION_TIMEOUT_MS = 15 * 1000; // 15 seconds
|
|
527
527
|
/** Initial reconnect delay in ms */
|
|
528
|
-
const INITIAL_RECONNECT_DELAY_MS = 1000;
|
|
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 = 500;
|
|
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.
|
|
1551
|
+
const version = "0.7.2-eap-crashlytics.e21972d2a";
|
|
1561
1552
|
|
|
1562
1553
|
/**
|
|
1563
1554
|
* @license
|
|
@@ -3149,6 +3140,7 @@ function makeMemoryCacheProvider() {
|
|
|
3149
3140
|
* See the License for the specific language governing permissions and
|
|
3150
3141
|
* limitations under the License.
|
|
3151
3142
|
*/
|
|
3143
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
3152
3144
|
function registerDataConnect(variant) {
|
|
3153
3145
|
setSDKVersion(SDK_VERSION$1);
|
|
3154
3146
|
_registerComponent(new Component('data-connect', (container, { instanceIdentifier: connectorConfigStr, options }) => {
|