@cloudcare/browser-rum 3.2.38 → 3.2.40
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/bundle/dataflux-rum.js +1 -1
- package/cjs/boot/buildEnv.js +1 -1
- package/cjs/boot/perStartRum.js +7 -1
- package/cjs/boot/perStartRum.js.map +1 -1
- package/cjs/boot/recorderApi.js +10 -1
- package/cjs/boot/recorderApi.js.map +1 -1
- package/cjs/boot/rum.js +4 -1
- package/cjs/boot/rum.js.map +1 -1
- package/cjs/boot/rumPublicApi.js +13 -2
- package/cjs/boot/rumPublicApi.js.map +1 -1
- package/cjs/boot/startRecording.js +2 -1
- package/cjs/boot/startRecording.js.map +1 -1
- package/cjs/domain/assembly.js +2 -1
- package/cjs/domain/assembly.js.map +1 -1
- package/cjs/domain/deflate/deflateEncoder.js +1 -15
- package/cjs/domain/deflate/deflateEncoder.js.map +1 -1
- package/cjs/domain/deflate/deflateWorker.js +1 -1
- package/cjs/domain/requestCollection.js +3 -0
- package/cjs/domain/requestCollection.js.map +1 -1
- package/cjs/domain/rumEventsCollection/error/errorCollection.js +3 -3
- package/cjs/domain/rumEventsCollection/error/errorCollection.js.map +1 -1
- package/cjs/domain/rumEventsCollection/resource/resourceCollection.js +1 -0
- package/cjs/domain/rumEventsCollection/resource/resourceCollection.js.map +1 -1
- package/cjs/domain/rumSessionManager.js +27 -7
- package/cjs/domain/rumSessionManager.js.map +1 -1
- package/esm/boot/buildEnv.js +1 -1
- package/esm/boot/perStartRum.js +7 -1
- package/esm/boot/perStartRum.js.map +1 -1
- package/esm/boot/recorderApi.js +10 -1
- package/esm/boot/recorderApi.js.map +1 -1
- package/esm/boot/rum.js +4 -1
- package/esm/boot/rum.js.map +1 -1
- package/esm/boot/rumPublicApi.js +13 -2
- package/esm/boot/rumPublicApi.js.map +1 -1
- package/esm/boot/startRecording.js +2 -1
- package/esm/boot/startRecording.js.map +1 -1
- package/esm/domain/assembly.js +2 -1
- package/esm/domain/assembly.js.map +1 -1
- package/esm/domain/deflate/deflateEncoder.js +1 -15
- package/esm/domain/deflate/deflateEncoder.js.map +1 -1
- package/esm/domain/deflate/deflateWorker.js +1 -1
- package/esm/domain/requestCollection.js +3 -0
- package/esm/domain/requestCollection.js.map +1 -1
- package/esm/domain/rumEventsCollection/error/errorCollection.js +3 -3
- package/esm/domain/rumEventsCollection/error/errorCollection.js.map +1 -1
- package/esm/domain/rumEventsCollection/resource/resourceCollection.js +1 -0
- package/esm/domain/rumEventsCollection/resource/resourceCollection.js.map +1 -1
- package/esm/domain/rumSessionManager.js +28 -8
- package/esm/domain/rumSessionManager.js.map +1 -1
- package/package.json +6 -6
- package/src/boot/perStartRum.js +7 -4
- package/src/boot/recorderApi.js +10 -3
- package/src/boot/rum.js +4 -2
- package/src/boot/rumPublicApi.js +11 -2
- package/src/boot/startRecording.js +2 -1
- package/src/domain/assembly.js +2 -1
- package/src/domain/deflate/deflateEncoder.js +4 -19
- package/src/domain/requestCollection.js +2 -0
- package/src/domain/rumEventsCollection/error/errorCollection.js +3 -3
- package/src/domain/rumEventsCollection/resource/resourceCollection.js +1 -0
- package/src/domain/rumSessionManager.js +29 -8
- package/types/index.d.ts +3 -0
|
@@ -6,7 +6,8 @@ import {
|
|
|
6
6
|
Observable,
|
|
7
7
|
timeStampNow,
|
|
8
8
|
bridgeSupports,
|
|
9
|
-
BridgeCapability
|
|
9
|
+
BridgeCapability,
|
|
10
|
+
SESSION_NOT_TRACKED
|
|
10
11
|
} from '@cloudcare/browser-core'
|
|
11
12
|
|
|
12
13
|
export var RUM_SESSION_KEY = 'rum'
|
|
@@ -18,7 +19,7 @@ export var RumSessionPlan = {
|
|
|
18
19
|
}
|
|
19
20
|
export const ERROR_SESSION = '1'
|
|
20
21
|
export var RumTrackingType = {
|
|
21
|
-
NOT_TRACKED:
|
|
22
|
+
NOT_TRACKED: SESSION_NOT_TRACKED,
|
|
22
23
|
// Note: the "tracking type" value (stored in the session cookie) does not match the "session
|
|
23
24
|
// plan" value (sent in RUM events). This is expected, and was done to keep retrocompatibility
|
|
24
25
|
// with active sessions when upgrading the SDK.
|
|
@@ -56,12 +57,21 @@ export function startRumSessionManager(configuration, lifeCycle) {
|
|
|
56
57
|
sessionEntity.ets = newState.ets || timeStampNow()
|
|
57
58
|
}
|
|
58
59
|
}
|
|
60
|
+
if (!previousState.forcedSession && newState.forcedSession) {
|
|
61
|
+
const sessionEntity = sessionManager.findSession()
|
|
62
|
+
if (sessionEntity) {
|
|
63
|
+
sessionEntity.isSessionForced = true
|
|
64
|
+
}
|
|
65
|
+
}
|
|
59
66
|
}
|
|
60
67
|
)
|
|
61
68
|
return {
|
|
62
69
|
findTrackedSession: function (startTime) {
|
|
63
70
|
var session = sessionManager.findSession(startTime)
|
|
64
|
-
if (!session
|
|
71
|
+
if (!session) {
|
|
72
|
+
return
|
|
73
|
+
}
|
|
74
|
+
if (!isTypeTracked(session.trackingType) && !session.isSessionForced) {
|
|
65
75
|
return
|
|
66
76
|
}
|
|
67
77
|
const isErrorSession =
|
|
@@ -97,16 +107,21 @@ export function startRumSessionManager(configuration, lifeCycle) {
|
|
|
97
107
|
sessionHasError: session.hasError,
|
|
98
108
|
isErrorSession: isErrorSession,
|
|
99
109
|
sessionErrorTimestamp: session.ets,
|
|
110
|
+
isSessionForced: session.isSessionForced,
|
|
100
111
|
sessionReplayAllowed:
|
|
101
112
|
plan === RumSessionPlan.WITH_SESSION_REPLAY ||
|
|
102
|
-
plan === RumSessionPlan.WITH_ERROR_SESSION_REPLAY
|
|
113
|
+
plan === RumSessionPlan.WITH_ERROR_SESSION_REPLAY ||
|
|
114
|
+
session.isSessionForced
|
|
103
115
|
}
|
|
104
116
|
},
|
|
105
117
|
expire: sessionManager.expire,
|
|
106
118
|
expireObservable: sessionManager.expireObservable,
|
|
107
119
|
sessionStateUpdateObservable: sessionManager.sessionStateUpdateObservable,
|
|
108
120
|
setErrorForSession: () =>
|
|
109
|
-
sessionManager.updateSessionState({ hasError: '1', ets: timeStampNow() })
|
|
121
|
+
sessionManager.updateSessionState({ hasError: '1', ets: timeStampNow() }),
|
|
122
|
+
setForcedSession: () => {
|
|
123
|
+
sessionManager.updateSessionState({ forcedSession: '1' })
|
|
124
|
+
}
|
|
110
125
|
}
|
|
111
126
|
}
|
|
112
127
|
|
|
@@ -117,14 +132,14 @@ export function startRumSessionManager(configuration, lifeCycle) {
|
|
|
117
132
|
export function startRumSessionManagerStub() {
|
|
118
133
|
var session = {
|
|
119
134
|
id: '00000000-aaaa-0000-aaaa-000000000000',
|
|
120
|
-
plan: RumSessionPlan.WITHOUT_SESSION_REPLAY, // plan value should not be taken into account for mobile
|
|
121
135
|
isErrorSession: false,
|
|
122
136
|
sessionErrorTimestamp: 0,
|
|
123
137
|
sessionReplayAllowed: bridgeSupports(BridgeCapability.RECORDS)
|
|
124
138
|
? true
|
|
125
139
|
: false,
|
|
126
140
|
errorSessionReplayAllowed: false,
|
|
127
|
-
sessionHasError: false
|
|
141
|
+
sessionHasError: false,
|
|
142
|
+
isSessionForced: false
|
|
128
143
|
}
|
|
129
144
|
return {
|
|
130
145
|
findTrackedSession: function () {
|
|
@@ -132,7 +147,13 @@ export function startRumSessionManagerStub() {
|
|
|
132
147
|
},
|
|
133
148
|
expire: noop,
|
|
134
149
|
expireObservable: new Observable(),
|
|
135
|
-
setErrorForSession: function () {
|
|
150
|
+
setErrorForSession: function () {
|
|
151
|
+
session.sessionErrorTimestamp = timeStampNow()
|
|
152
|
+
session.sessionHasError = true
|
|
153
|
+
session.isErrorSession = true
|
|
154
|
+
session.errorSessionReplayAllowed = true
|
|
155
|
+
},
|
|
156
|
+
setForcedSession: noop
|
|
136
157
|
}
|
|
137
158
|
}
|
|
138
159
|
|
package/types/index.d.ts
CHANGED
|
@@ -49,6 +49,7 @@ export declare const datafluxRum: {
|
|
|
49
49
|
| RumInitConfiguration
|
|
50
50
|
| RumSiteInitConfiguration
|
|
51
51
|
| undefined
|
|
52
|
+
getRemoteConfiguration: () => Object | undefined
|
|
52
53
|
addAction: (name: string, context?: object | undefined) => void
|
|
53
54
|
addTypeAction: (
|
|
54
55
|
name: string,
|
|
@@ -63,8 +64,10 @@ export declare const datafluxRum: {
|
|
|
63
64
|
removeUserProperty: (key: any) => void
|
|
64
65
|
clearUser: () => void
|
|
65
66
|
stopSession: () => void
|
|
67
|
+
setForcedSession: () => void
|
|
66
68
|
startSessionReplayRecording: () => void
|
|
67
69
|
stopSessionReplayRecording: () => void
|
|
70
|
+
takeSubsequentFullSnapshot: () => void
|
|
68
71
|
} & {
|
|
69
72
|
onReady(callback: () => void): void
|
|
70
73
|
}
|