@cloudcare/browser-logs 2.0.5 → 2.0.7

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,4 +1,8 @@
1
- import { performDraw, startSessionManager } from '@cloudcare/browser-core'
1
+ import {
2
+ performDraw,
3
+ startSessionManager,
4
+ Observable
5
+ } from '@cloudcare/browser-core'
2
6
 
3
7
  export var LOGS_SESSION_KEY = 'logs'
4
8
 
@@ -23,17 +27,22 @@ export function startLogsSessionManager(configuration) {
23
27
  id: session.id
24
28
  }
25
29
  : undefined
26
- }
30
+ },
31
+ expireObservable: sessionManager.expireObservable
27
32
  }
28
33
  }
29
34
 
30
- // export function startLogsSessionManagerStub(configuration) {
31
- // var isTracked = computeTrackingType(configuration) === LoggerTrackingType.TRACKED
32
- // var session = isTracked ? {} : undefined
33
- // return {
34
- // findTrackedSession: function() { return session },
35
- // }
36
- // }
35
+ export function startLogsSessionManagerStub(configuration) {
36
+ var isTracked =
37
+ computeTrackingType(configuration) === LoggerTrackingType.TRACKED
38
+ var session = isTracked ? {} : undefined
39
+ return {
40
+ findTrackedSession: function () {
41
+ return session
42
+ },
43
+ expireObservable: new Observable()
44
+ }
45
+ }
37
46
 
38
47
  function computeTrackingType(configuration) {
39
48
  if (!performDraw(configuration.sessionSampleRate)) {
@@ -7,13 +7,15 @@ export function startLogsBatch(
7
7
  configuration,
8
8
  lifeCycle,
9
9
  reportError,
10
- pageExitObservable
10
+ pageExitObservable,
11
+ sessionExpireObservable
11
12
  ) {
12
13
  var batch = startBatchWithReplica(
13
14
  configuration,
14
15
  configuration.logsEndpoint,
15
16
  reportError,
16
- pageExitObservable
17
+ pageExitObservable,
18
+ sessionExpireObservable
17
19
  )
18
20
 
19
21
  lifeCycle.subscribe(