@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.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.1";
7
+ const version = "0.7.2-eap-crashlytics.e21972d2a";
8
8
 
9
9
  /**
10
10
  * @license
@@ -1663,17 +1663,13 @@ class RESTTransport extends AbstractDataConnectTransport {
1663
1663
  /** The Request ID of the first request over the stream */
1664
1664
  const FIRST_REQUEST_ID = 1;
1665
1665
  /** Time to wait before closing an idle connection (no active subscriptions). */
1666
- const IDLE_CONNECTION_TIMEOUT_MS = 0; // immediate close
1666
+ const IDLE_CONNECTION_TIMEOUT_MS = 15 * 1000; // 15 seconds
1667
1667
  /** Initial reconnect delay in ms */
1668
- const INITIAL_RECONNECT_DELAY_MS = 1000;
1668
+ const INITIAL_RECONNECT_DELAY_MS = 1000; // 1 second
1669
1669
  /** Max reconnect delay in ms */
1670
- const MAX_RECONNECT_DELAY_MS = 30000;
1671
- /** Max random jitter to add to reconnect delay in ms */
1672
- const MAX_RECONNECT_JITTER_MS = 500;
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.3;
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
- if (this.reconnectAttempts++ >= MAX_RECONNECT_ATTEMPTS) {
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() * MAX_RECONNECT_JITTER_MS;
1927
+ const jitter = (Math.random() - 0.5) * delay;
1937
1928
  this.reconnectTimer = setTimeout(() => {
1938
1929
  this.reconnectTimer = null;
1939
1930
  void this.attemptReconnect();
@@ -3133,6 +3124,7 @@ function makeMemoryCacheProvider() {
3133
3124
  * See the License for the specific language governing permissions and
3134
3125
  * limitations under the License.
3135
3126
  */
3127
+ // eslint-disable-next-line import/no-extraneous-dependencies
3136
3128
  function registerDataConnect(variant) {
3137
3129
  setSDKVersion(SDK_VERSION$1);
3138
3130
  _registerComponent(new Component('data-connect', (container, { instanceIdentifier: connectorConfigStr, options }) => {