@microsoft/applicationinsights-analytics-js 2.8.0-beta.2203-06 → 2.8.0-beta.2203-07

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.
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Microsoft Application Insights JavaScript SDK - Web Analytics, 2.8.0-beta.2203-06
2
+ * Microsoft Application Insights JavaScript SDK - Web Analytics, 2.8.0-beta.2203-07
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  *
5
5
  * Microsoft Application Insights Team
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Application Insights JavaScript SDK - Web Analytics, 2.8.0-beta.2203-06
2
+ * Application Insights JavaScript SDK - Web Analytics, 2.8.0-beta.2203-07
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
  (function (global, factory) {
@@ -3592,11 +3592,9 @@
3592
3592
  if (core) {
3593
3593
  _logger = core.logger;
3594
3594
  }
3595
- function _flushChannels() {
3595
+ function _flushChannels(isAsync) {
3596
3596
  if (core) {
3597
- arrForEach(core.getTransmissionControls(), function (queues) {
3598
- arrForEach(queues, function (q) { q.flush(true); });
3599
- });
3597
+ core.flush(isAsync);
3600
3598
  }
3601
3599
  }
3602
3600
  function _addQueue(cb) {
@@ -3619,7 +3617,7 @@
3619
3617
  intervalHandle = null;
3620
3618
  }
3621
3619
  if (doFlush) {
3622
- _flushChannels();
3620
+ _flushChannels(true);
3623
3621
  }
3624
3622
  }), 100);
3625
3623
  }
@@ -3637,7 +3635,7 @@
3637
3635
  }
3638
3636
  if (!pageViewPerformanceManager.isPerformanceTimingSupported()) {
3639
3637
  appInsights.sendPageViewInternal(pageView, customProperties);
3640
- _flushChannels();
3638
+ _flushChannels(true);
3641
3639
  _logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.NavigationTimingNotSupported, "trackPageView: navigation timing API used for calculation of page duration is not supported in this browser. This page view will be collected without duration and timing info.");
3642
3640
  return;
3643
3641
  }
@@ -3663,7 +3661,7 @@
3663
3661
  customProperties["duration"] = customDuration;
3664
3662
  }
3665
3663
  appInsights.sendPageViewInternal(pageView, customProperties);
3666
- _flushChannels();
3664
+ _flushChannels(true);
3667
3665
  pageViewSent = true;
3668
3666
  }
3669
3667
  var maxDurationLimit = 60000;
@@ -3709,6 +3707,17 @@
3709
3707
  return processed;
3710
3708
  });
3711
3709
  };
3710
+ _self.teardown = function (unloadCtx, unloadState) {
3711
+ if (intervalHandle) {
3712
+ clearInterval(intervalHandle);
3713
+ intervalHandle = null;
3714
+ var allItems = itemQueue.slice(0);
3715
+ itemQueue = [];
3716
+ arrForEach(allItems, function (item) {
3717
+ if (item()) ;
3718
+ });
3719
+ }
3720
+ };
3712
3721
  });
3713
3722
  }
3714
3723
  return PageViewManager;
@@ -4198,7 +4207,7 @@
4198
4207
  }
4199
4208
  _base.initialize(config, core, extensions, pluginChain);
4200
4209
  try {
4201
- _evtNamespace = mergeEvtNamespace(createUniqueNamespace("AnalyticsPlugin"), core.evtNamespace && core.evtNamespace());
4210
+ _evtNamespace = mergeEvtNamespace(createUniqueNamespace(_self.identifier), core.evtNamespace && core.evtNamespace());
4202
4211
  if (_preInitTelemetryInitializers) {
4203
4212
  arrForEach(_preInitTelemetryInitializers, function (initializer) {
4204
4213
  core.addTelemetryInitializer(initializer);
@@ -4245,6 +4254,7 @@
4245
4254
  }
4246
4255
  };
4247
4256
  _self._doTeardown = function (unloadCtx, unloadState) {
4257
+ _pageViewManager && _pageViewManager.teardown(unloadCtx, unloadState);
4248
4258
  eventOff(window, null, null, _evtNamespace);
4249
4259
  _initDefaults();
4250
4260
  };
@@ -4430,7 +4440,7 @@
4430
4440
  });
4431
4441
  return _this;
4432
4442
  }
4433
- AnalyticsPlugin.Version = "2.8.0-beta.2203-06";
4443
+ AnalyticsPlugin.Version = "2.8.0-beta.2203-07";
4434
4444
  AnalyticsPlugin.getDefaultConfig = _getDefaultConfig;
4435
4445
  return AnalyticsPlugin;
4436
4446
  }(BaseTelemetryPlugin));