@firebase/database-compat 0.2.2-canary.69e2ee064 → 0.2.2-canary.6a8be1337

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.
@@ -5,7 +5,7 @@ import { errorPrefix, validateArgCount, validateCallback, validateContextObject,
5
5
  import { Logger } from '@firebase/logger';
6
6
 
7
7
  const name = "@firebase/database-compat";
8
- const version = "0.2.2-canary.69e2ee064";
8
+ const version = "0.2.2-canary.6a8be1337";
9
9
 
10
10
  /**
11
11
  * @license
@@ -6,7 +6,7 @@ import { __extends } from 'tslib';
6
6
  import { Logger } from '@firebase/logger';
7
7
 
8
8
  var name = "@firebase/database-compat";
9
- var version = "0.2.2-canary.69e2ee064";
9
+ var version = "0.2.2-canary.6a8be1337";
10
10
 
11
11
  /**
12
12
  * @license
package/dist/index.js CHANGED
@@ -12,7 +12,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
12
12
  var firebase__default = /*#__PURE__*/_interopDefaultLegacy(firebase);
13
13
 
14
14
  var name = "@firebase/database-compat";
15
- var version = "0.2.2-canary.69e2ee064";
15
+ var version = "0.2.2-canary.6a8be1337";
16
16
 
17
17
  /**
18
18
  * @license
@@ -4383,7 +4383,7 @@ var WebSocketConnection = /** @class */ (function () {
4383
4383
  if (util.isNodeSdk()) {
4384
4384
  var device = this.nodeAdmin ? 'AdminNode' : 'Node';
4385
4385
  // UA Format: Firebase/<wire_protocol>/<sdk_version>/<platform>/<device>
4386
- var options_1 = {
4386
+ options = {
4387
4387
  headers: {
4388
4388
  'User-Agent': "Firebase/" + PROTOCOL_VERSION + "/" + SDK_VERSION + "/" + process.platform + "/" + device,
4389
4389
  'X-Firebase-GMPID': this.applicationId || ''
@@ -4395,10 +4395,10 @@ var WebSocketConnection = /** @class */ (function () {
4395
4395
  // Note that this header is just used to bypass appcheck, and the token should still be sent
4396
4396
  // through the websocket connection once it is established.
4397
4397
  if (this.authToken) {
4398
- options_1.headers['Authorization'] = "Bearer " + this.authToken;
4398
+ options.headers['Authorization'] = "Bearer " + this.authToken;
4399
4399
  }
4400
4400
  if (this.appCheckToken) {
4401
- options_1.headers['X-Firebase-AppCheck'] = this.appCheckToken;
4401
+ options.headers['X-Firebase-AppCheck'] = this.appCheckToken;
4402
4402
  }
4403
4403
  // Plumb appropriate http_proxy environment variable into faye-websocket if it exists.
4404
4404
  var env = process['env'];
@@ -4406,7 +4406,7 @@ var WebSocketConnection = /** @class */ (function () {
4406
4406
  ? env['HTTPS_PROXY'] || env['https_proxy']
4407
4407
  : env['HTTP_PROXY'] || env['http_proxy'];
4408
4408
  if (proxy) {
4409
- options_1['proxy'] = { origin: proxy };
4409
+ options['proxy'] = { origin: proxy };
4410
4410
  }
4411
4411
  }
4412
4412
  this.mySock = new WebSocketImpl(this.connURL, [], options);
@@ -6649,7 +6649,6 @@ var VisibilityMonitor = /** @class */ (function (_super) {
6649
6649
  */
6650
6650
  var RECONNECT_MIN_DELAY = 1000;
6651
6651
  var RECONNECT_MAX_DELAY_DEFAULT = 60 * 5 * 1000; // 5 minutes in milliseconds (Case: 1858)
6652
- var GET_CONNECT_TIMEOUT = 3 * 1000;
6653
6652
  var RECONNECT_MAX_DELAY_FOR_ADMINS = 30 * 1000; // 30 seconds for admin clients (likely to be a backend server)
6654
6653
  var RECONNECT_DELAY_MULTIPLIER = 1.3;
6655
6654
  var RECONNECT_DELAY_RESET_TIMEOUT = 30000; // Reset delay back to MIN_DELAY after being connected for 30sec.
@@ -6728,7 +6727,6 @@ var PersistentConnection = /** @class */ (function (_super) {
6728
6727
  }
6729
6728
  };
6730
6729
  PersistentConnection.prototype.get = function (query) {
6731
- var _this = this;
6732
6730
  this.initConnection_();
6733
6731
  var deferred = new util.Deferred();
6734
6732
  var request = {
@@ -6751,21 +6749,6 @@ var PersistentConnection = /** @class */ (function (_super) {
6751
6749
  this.outstandingGets_.push(outstandingGet);
6752
6750
  this.outstandingGetCount_++;
6753
6751
  var index = this.outstandingGets_.length - 1;
6754
- if (!this.connected_) {
6755
- setTimeout(function () {
6756
- var get = _this.outstandingGets_[index];
6757
- if (get === undefined || outstandingGet !== get) {
6758
- return;
6759
- }
6760
- delete _this.outstandingGets_[index];
6761
- _this.outstandingGetCount_--;
6762
- if (_this.outstandingGetCount_ === 0) {
6763
- _this.outstandingGets_ = [];
6764
- }
6765
- _this.log_('get ' + index + ' timed out on connection');
6766
- deferred.reject(new Error('Client is offline.'));
6767
- }, GET_CONNECT_TIMEOUT);
6768
- }
6769
6752
  if (this.connected_) {
6770
6753
  this.sendGet_(index);
6771
6754
  }