@firebase/storage 0.8.6-2021108175111 → 0.8.6-canary.e0fe2b668

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/CHANGELOG.md CHANGED
@@ -1,15 +1,14 @@
1
1
  #Unreleased
2
2
 
3
- ## 0.8.6-2021108175111
3
+ ## 0.8.6
4
4
 
5
5
  ### Patch Changes
6
6
 
7
7
  - [`3281315fa`](https://github.com/firebase/firebase-js-sdk/commit/3281315fae9c6f535f9d5052ee17d60861ea569a) [#5708](https://github.com/firebase/firebase-js-sdk/pull/5708) (fixes [#1487](https://github.com/firebase/firebase-js-sdk/issues/1487)) - Update build scripts to work with the exports field
8
8
 
9
9
  - Updated dependencies [[`3281315fa`](https://github.com/firebase/firebase-js-sdk/commit/3281315fae9c6f535f9d5052ee17d60861ea569a)]:
10
- - @firebase/app@0.7.7-2021108175111
11
- - @firebase/component@0.5.9-2021108175111
12
- - @firebase/util@1.4.2-2021108175111
10
+ - @firebase/component@0.5.9
11
+ - @firebase/util@1.4.2
13
12
 
14
13
  ## 0.8.5
15
14
 
@@ -359,7 +359,9 @@ callback, timeout) {
359
359
  // Would type this as "number" but that doesn't work for Node so ¯\_(ツ)_/¯
360
360
  // TODO: find a way to exclude Node type definition for storage because storage only works in browser
361
361
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
362
- var timeoutId = null;
362
+ var retryTimeoutId = null;
363
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
364
+ var globalTimeoutId = null;
363
365
  var hitTimeout = false;
364
366
  var cancelState = 0;
365
367
  function canceled() {
@@ -377,25 +379,33 @@ callback, timeout) {
377
379
  }
378
380
  }
379
381
  function callWithDelay(millis) {
380
- timeoutId = setTimeout(function () {
381
- timeoutId = null;
382
+ retryTimeoutId = setTimeout(function () {
383
+ retryTimeoutId = null;
382
384
  f(handler, canceled());
383
385
  }, millis);
384
386
  }
387
+ function clearGlobalTimeout() {
388
+ if (globalTimeoutId) {
389
+ clearTimeout(globalTimeoutId);
390
+ }
391
+ }
385
392
  function handler(success) {
386
393
  var args = [];
387
394
  for (var _i = 1; _i < arguments.length; _i++) {
388
395
  args[_i - 1] = arguments[_i];
389
396
  }
390
397
  if (triggeredCallback) {
398
+ clearGlobalTimeout();
391
399
  return;
392
400
  }
393
401
  if (success) {
402
+ clearGlobalTimeout();
394
403
  triggerCallback.call.apply(triggerCallback, tslib.__spreadArray([null, success], args));
395
404
  return;
396
405
  }
397
406
  var mustStop = canceled() || hitTimeout;
398
407
  if (mustStop) {
408
+ clearGlobalTimeout();
399
409
  triggerCallback.call.apply(triggerCallback, tslib.__spreadArray([null, success], args));
400
410
  return;
401
411
  }
@@ -419,14 +429,15 @@ callback, timeout) {
419
429
  return;
420
430
  }
421
431
  stopped = true;
432
+ clearGlobalTimeout();
422
433
  if (triggeredCallback) {
423
434
  return;
424
435
  }
425
- if (timeoutId !== null) {
436
+ if (retryTimeoutId !== null) {
426
437
  if (!wasTimeout) {
427
438
  cancelState = 2;
428
439
  }
429
- clearTimeout(timeoutId);
440
+ clearTimeout(retryTimeoutId);
430
441
  callWithDelay(0);
431
442
  }
432
443
  else {
@@ -436,7 +447,7 @@ callback, timeout) {
436
447
  }
437
448
  }
438
449
  callWithDelay(0);
439
- setTimeout(function () {
450
+ globalTimeoutId = setTimeout(function () {
440
451
  hitTimeout = true;
441
452
  stop(true);
442
453
  }, timeout);
@@ -3280,7 +3291,7 @@ var FirebaseStorageImpl = /** @class */ (function () {
3280
3291
  }());
3281
3292
 
3282
3293
  var name = "@firebase/storage";
3283
- var version = "0.8.6-2021108175111";
3294
+ var version = "0.8.6-canary.e0fe2b668";
3284
3295
 
3285
3296
  /**
3286
3297
  * @license