@cloudcare/browser-rum 3.3.5 → 3.3.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.
- package/README.md +24 -3
- package/README.zh.md +19 -3
- package/bundle/dataflux-rum.js +1 -1
- package/cjs/boot/buildEnv.js +1 -1
- package/cjs/boot/buildEnv.js.map +1 -1
- package/cjs/boot/perStartRum.js +42 -6
- package/cjs/boot/perStartRum.js.map +1 -1
- package/cjs/boot/recorderApi.js +190 -195
- package/cjs/boot/recorderApi.js.map +1 -1
- package/cjs/boot/recorderApiStub.js +3 -29
- package/cjs/boot/recorderApiStub.js.map +1 -1
- package/cjs/boot/rum.entry.js.map +1 -1
- package/cjs/boot/rum.js +8 -0
- package/cjs/boot/rum.js.map +1 -1
- package/cjs/boot/rum.slim.entry.js.map +1 -1
- package/cjs/boot/rumEntryFactory.js.map +1 -1
- package/cjs/boot/rumPublicApi.js +36 -3
- package/cjs/boot/rumPublicApi.js.map +1 -1
- package/cjs/boot/rumRecorderApiStub.js.map +1 -1
- package/cjs/boot/rumSlimConfiguration.js.map +1 -1
- package/cjs/boot/sessionReplayPublicApi.js +14 -27
- package/cjs/boot/sessionReplayPublicApi.js.map +1 -1
- package/cjs/boot/startRecording.js +333 -108
- package/cjs/boot/startRecording.js.map +1 -1
- package/cjs/constants.js.map +1 -1
- package/cjs/domain/assembly.js +1 -7
- package/cjs/domain/assembly.js.map +1 -1
- package/cjs/domain/configuration.js +38 -43
- package/cjs/domain/configuration.js.map +1 -1
- package/cjs/domain/contexts/commonContext.js.map +1 -1
- package/cjs/domain/contexts/displayContext.js.map +1 -1
- package/cjs/domain/contexts/foregroundContexts.js.map +1 -1
- package/cjs/domain/contexts/internalContext.js.map +1 -1
- package/cjs/domain/contexts/pageStateHistory.js.map +1 -1
- package/cjs/domain/contexts/urlContexts.js +20 -2
- package/cjs/domain/contexts/urlContexts.js.map +1 -1
- package/cjs/domain/contexts/viewContexts.js +2 -2
- package/cjs/domain/contexts/viewContexts.js.map +1 -1
- package/cjs/domain/deflate/deflateEncoder.js +517 -39
- package/cjs/domain/deflate/deflateEncoder.js.map +1 -1
- package/cjs/domain/deflate/deflateWorker.js +194 -115
- package/cjs/domain/deflate/deflateWorker.js.map +1 -1
- package/cjs/domain/deflate/index.js.map +1 -1
- package/cjs/domain/domMutationObservable.js.map +1 -1
- package/cjs/domain/encoderStreamId.js.map +1 -1
- package/cjs/domain/firstInputPolyfill.js.map +1 -1
- package/cjs/domain/initViewportObservable.js.map +1 -1
- package/cjs/domain/locationChangeObservable.js.map +1 -1
- package/cjs/domain/performanceObservable.js.map +1 -1
- package/cjs/domain/performanceUtils.js.map +1 -1
- package/cjs/domain/plugins.js +67 -0
- package/cjs/domain/plugins.js.map +1 -0
- package/cjs/domain/replay/record/canvasAutoSnapshot.js.map +1 -1
- package/cjs/domain/replay/record/canvasCommandCapture.js +968 -167
- package/cjs/domain/replay/record/canvasCommandCapture.js.map +1 -1
- package/cjs/domain/replay/record/canvasCommandObserver.js +1058 -119
- package/cjs/domain/replay/record/canvasCommandObserver.js.map +1 -1
- package/cjs/domain/replay/record/canvasCommandSerializeArgs.js +61 -37
- package/cjs/domain/replay/record/canvasCommandSerializeArgs.js.map +1 -1
- package/cjs/domain/replay/record/canvasContext.js +63 -0
- package/cjs/domain/replay/record/canvasContext.js.map +1 -0
- package/cjs/domain/replay/record/canvasContinuousScheduler.js +246 -118
- package/cjs/domain/replay/record/canvasContinuousScheduler.js.map +1 -1
- package/cjs/domain/replay/record/canvasEncodeBridge.js +539 -87
- package/cjs/domain/replay/record/canvasEncodeBridge.js.map +1 -1
- package/cjs/domain/replay/record/canvasEncodeWorker.js +50 -32
- package/cjs/domain/replay/record/canvasEncodeWorker.js.map +1 -1
- package/cjs/domain/replay/record/canvasFrameSignature.js +49 -17
- package/cjs/domain/replay/record/canvasFrameSignature.js.map +1 -1
- package/cjs/domain/replay/record/canvasMutationRecord.js.map +1 -1
- package/cjs/domain/replay/record/canvasObserver.js +295 -59
- package/cjs/domain/replay/record/canvasObserver.js.map +1 -1
- package/cjs/domain/replay/record/canvasSerializeArgs.js.map +1 -1
- package/cjs/domain/replay/record/canvasWebGLPluginHost.js +33 -0
- package/cjs/domain/replay/record/canvasWebGLPluginHost.js.map +1 -0
- package/cjs/domain/replay/record/elementsScrollPositions.js +3 -0
- package/cjs/domain/replay/record/elementsScrollPositions.js.map +1 -1
- package/cjs/domain/replay/record/index.js.map +1 -1
- package/cjs/domain/replay/record/mutationBatch.js +542 -25
- package/cjs/domain/replay/record/mutationBatch.js.map +1 -1
- package/cjs/domain/replay/record/mutationObserver.js +1900 -191
- package/cjs/domain/replay/record/mutationObserver.js.map +1 -1
- package/cjs/domain/replay/record/mutationResourceBudget.js +144 -0
- package/cjs/domain/replay/record/mutationResourceBudget.js.map +1 -0
- package/cjs/domain/replay/record/observers.js +222 -53
- package/cjs/domain/replay/record/observers.js.map +1 -1
- package/cjs/domain/replay/record/privacy.js +31 -8
- package/cjs/domain/replay/record/privacy.js.map +1 -1
- package/cjs/domain/replay/record/record.js +3083 -321
- package/cjs/domain/replay/record/record.js.map +1 -1
- package/cjs/domain/replay/record/serializationUtils.js +426 -26
- package/cjs/domain/replay/record/serializationUtils.js.map +1 -1
- package/cjs/domain/replay/record/serialize.js +259 -49
- package/cjs/domain/replay/record/serialize.js.map +1 -1
- package/cjs/domain/replay/record/shadowRootsController.js +875 -21
- package/cjs/domain/replay/record/shadowRootsController.js.map +1 -1
- package/cjs/domain/replay/record/utils.js.map +1 -1
- package/cjs/domain/replay/record/viewports.js.map +1 -1
- package/cjs/domain/replay/replayStats.js.map +1 -1
- package/cjs/domain/replay/segmentCollection/buildReplayPayload.js.map +1 -1
- package/cjs/domain/replay/segmentCollection/index.js.map +1 -1
- package/cjs/domain/replay/segmentCollection/segment.js +315 -11
- package/cjs/domain/replay/segmentCollection/segment.js.map +1 -1
- package/cjs/domain/replay/segmentCollection/segmentCollection.js +956 -71
- package/cjs/domain/replay/segmentCollection/segmentCollection.js.map +1 -1
- package/cjs/domain/replay/startRecordBridge.js.map +1 -1
- package/cjs/domain/requestCollection.js.map +1 -1
- package/cjs/domain/rumEventsCollection/actions/actionCollection.js.map +1 -1
- package/cjs/domain/rumEventsCollection/actions/clickChain.js.map +1 -1
- package/cjs/domain/rumEventsCollection/actions/computeFrustration.js.map +1 -1
- package/cjs/domain/rumEventsCollection/actions/getActionNameFromElement.js.map +1 -1
- package/cjs/domain/rumEventsCollection/actions/getSelectorsFromElement.js.map +1 -1
- package/cjs/domain/rumEventsCollection/actions/interactionSelectorCache.js.map +1 -1
- package/cjs/domain/rumEventsCollection/actions/listenActionEvents.js.map +1 -1
- package/cjs/domain/rumEventsCollection/actions/trackClickActions.js.map +1 -1
- package/cjs/domain/rumEventsCollection/error/errorCollection.js.map +1 -1
- package/cjs/domain/rumEventsCollection/error/trackConsoleError.js.map +1 -1
- package/cjs/domain/rumEventsCollection/error/trackReportError.js.map +1 -1
- package/cjs/domain/rumEventsCollection/longTask/longAnimationFrameCollection.js.map +1 -1
- package/cjs/domain/rumEventsCollection/longTask/longTaskCollection.js.map +1 -1
- package/cjs/domain/rumEventsCollection/resource/matchRequestResourceEntry.js.map +1 -1
- package/cjs/domain/rumEventsCollection/resource/resourceCollection.js +56 -0
- package/cjs/domain/rumEventsCollection/resource/resourceCollection.js.map +1 -1
- package/cjs/domain/rumEventsCollection/resource/resourceTrackerManager.js.map +1 -1
- package/cjs/domain/rumEventsCollection/resource/resourceUtils.js.map +1 -1
- package/cjs/domain/rumEventsCollection/resource/retrieveInitialDocumentResourceTiming.js.map +1 -1
- package/cjs/domain/rumEventsCollection/resource/webSocketCollection.js +196 -0
- package/cjs/domain/rumEventsCollection/resource/webSocketCollection.js.map +1 -0
- package/cjs/domain/rumEventsCollection/view/interactionCountPolyfill.js.map +1 -1
- package/cjs/domain/rumEventsCollection/view/trackCommonViewMetrics.js.map +1 -1
- package/cjs/domain/rumEventsCollection/view/trackCumulativeLayoutShift.js.map +1 -1
- package/cjs/domain/rumEventsCollection/view/trackFirstContentfulPaint.js.map +1 -1
- package/cjs/domain/rumEventsCollection/view/trackFirstHidden.js.map +1 -1
- package/cjs/domain/rumEventsCollection/view/trackFirstInput.js.map +1 -1
- package/cjs/domain/rumEventsCollection/view/trackInitialViewTimings.js.map +1 -1
- package/cjs/domain/rumEventsCollection/view/trackInteractionToNextPaint.js.map +1 -1
- package/cjs/domain/rumEventsCollection/view/trackLargestContentfulPaint.js.map +1 -1
- package/cjs/domain/rumEventsCollection/view/trackLoadingTime.js +8 -3
- package/cjs/domain/rumEventsCollection/view/trackLoadingTime.js.map +1 -1
- package/cjs/domain/rumEventsCollection/view/trackNavigationTimings.js.map +1 -1
- package/cjs/domain/rumEventsCollection/view/trackScrollMetrics.js.map +1 -1
- package/cjs/domain/rumEventsCollection/view/trackViewEventCounts.js.map +1 -1
- package/cjs/domain/rumEventsCollection/view/trackViews.js +31 -12
- package/cjs/domain/rumEventsCollection/view/trackViews.js.map +1 -1
- package/cjs/domain/rumEventsCollection/view/viewCollection.js.map +1 -1
- package/cjs/domain/rumSessionManager.js +23 -3
- package/cjs/domain/rumSessionManager.js.map +1 -1
- package/cjs/domain/tracing/ddtraceTracer.js.map +1 -1
- package/cjs/domain/tracing/getDocumentTraceId.js.map +1 -1
- package/cjs/domain/tracing/jaegerTracer.js.map +1 -1
- package/cjs/domain/tracing/sampler.js.map +1 -1
- package/cjs/domain/tracing/skywalkingTracer.js.map +1 -1
- package/cjs/domain/tracing/traceIdentifier.js.map +1 -1
- package/cjs/domain/tracing/tracer.js +2 -2
- package/cjs/domain/tracing/tracer.js.map +1 -1
- package/cjs/domain/tracing/w3cTraceParentTracer.js.map +1 -1
- package/cjs/domain/tracing/zipkinMultiTracer.js.map +1 -1
- package/cjs/domain/tracing/zipkinSingleTracer.js.map +1 -1
- package/cjs/domain/trackEventCounts.js.map +1 -1
- package/cjs/domain/usr/index.js.map +1 -1
- package/cjs/domain/waitPageActivityEnd.js.map +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/transport/startRumBatch.js +3 -1
- package/cjs/transport/startRumBatch.js.map +1 -1
- package/cjs/transport/startRumEventBridge.js.map +1 -1
- package/cjs/types/index.js.map +1 -1
- package/cjs/types/sessionReplayConstants.js.map +1 -1
- package/esm/boot/buildEnv.js +1 -1
- package/esm/boot/buildEnv.js.map +1 -1
- package/esm/boot/perStartRum.js +42 -6
- package/esm/boot/perStartRum.js.map +1 -1
- package/esm/boot/recorderApi.js +192 -197
- package/esm/boot/recorderApi.js.map +1 -1
- package/esm/boot/recorderApiStub.js +3 -29
- package/esm/boot/recorderApiStub.js.map +1 -1
- package/esm/boot/rum.entry.js.map +1 -1
- package/esm/boot/rum.js +8 -0
- package/esm/boot/rum.js.map +1 -1
- package/esm/boot/rum.slim.entry.js.map +1 -1
- package/esm/boot/rumEntryFactory.js.map +1 -1
- package/esm/boot/rumPublicApi.js +36 -3
- package/esm/boot/rumPublicApi.js.map +1 -1
- package/esm/boot/rumRecorderApiStub.js.map +1 -1
- package/esm/boot/rumSlimConfiguration.js.map +1 -1
- package/esm/boot/sessionReplayPublicApi.js +14 -27
- package/esm/boot/sessionReplayPublicApi.js.map +1 -1
- package/esm/boot/startRecording.js +334 -109
- package/esm/boot/startRecording.js.map +1 -1
- package/esm/constants.js.map +1 -1
- package/esm/domain/assembly.js +1 -7
- package/esm/domain/assembly.js.map +1 -1
- package/esm/domain/configuration.js +39 -44
- package/esm/domain/configuration.js.map +1 -1
- package/esm/domain/contexts/commonContext.js.map +1 -1
- package/esm/domain/contexts/displayContext.js.map +1 -1
- package/esm/domain/contexts/foregroundContexts.js.map +1 -1
- package/esm/domain/contexts/internalContext.js.map +1 -1
- package/esm/domain/contexts/pageStateHistory.js.map +1 -1
- package/esm/domain/contexts/urlContexts.js +21 -3
- package/esm/domain/contexts/urlContexts.js.map +1 -1
- package/esm/domain/contexts/viewContexts.js +2 -2
- package/esm/domain/contexts/viewContexts.js.map +1 -1
- package/esm/domain/deflate/deflateEncoder.js +517 -39
- package/esm/domain/deflate/deflateEncoder.js.map +1 -1
- package/esm/domain/deflate/deflateWorker.js +193 -116
- package/esm/domain/deflate/deflateWorker.js.map +1 -1
- package/esm/domain/deflate/index.js.map +1 -1
- package/esm/domain/domMutationObservable.js.map +1 -1
- package/esm/domain/encoderStreamId.js.map +1 -1
- package/esm/domain/firstInputPolyfill.js.map +1 -1
- package/esm/domain/initViewportObservable.js.map +1 -1
- package/esm/domain/locationChangeObservable.js.map +1 -1
- package/esm/domain/performanceObservable.js.map +1 -1
- package/esm/domain/performanceUtils.js.map +1 -1
- package/esm/domain/plugins.js +59 -0
- package/esm/domain/plugins.js.map +1 -0
- package/esm/domain/replay/record/canvasAutoSnapshot.js.map +1 -1
- package/esm/domain/replay/record/canvasCommandCapture.js +968 -168
- package/esm/domain/replay/record/canvasCommandCapture.js.map +1 -1
- package/esm/domain/replay/record/canvasCommandObserver.js +1058 -119
- package/esm/domain/replay/record/canvasCommandObserver.js.map +1 -1
- package/esm/domain/replay/record/canvasCommandSerializeArgs.js +60 -37
- package/esm/domain/replay/record/canvasCommandSerializeArgs.js.map +1 -1
- package/esm/domain/replay/record/canvasContext.js +50 -0
- package/esm/domain/replay/record/canvasContext.js.map +1 -0
- package/esm/domain/replay/record/canvasContinuousScheduler.js +246 -118
- package/esm/domain/replay/record/canvasContinuousScheduler.js.map +1 -1
- package/esm/domain/replay/record/canvasEncodeBridge.js +539 -87
- package/esm/domain/replay/record/canvasEncodeBridge.js.map +1 -1
- package/esm/domain/replay/record/canvasEncodeWorker.js +51 -33
- package/esm/domain/replay/record/canvasEncodeWorker.js.map +1 -1
- package/esm/domain/replay/record/canvasFrameSignature.js +50 -17
- package/esm/domain/replay/record/canvasFrameSignature.js.map +1 -1
- package/esm/domain/replay/record/canvasMutationRecord.js.map +1 -1
- package/esm/domain/replay/record/canvasObserver.js +295 -59
- package/esm/domain/replay/record/canvasObserver.js.map +1 -1
- package/esm/domain/replay/record/canvasSerializeArgs.js.map +1 -1
- package/esm/domain/replay/record/canvasWebGLPluginHost.js +26 -0
- package/esm/domain/replay/record/canvasWebGLPluginHost.js.map +1 -0
- package/esm/domain/replay/record/elementsScrollPositions.js +3 -0
- package/esm/domain/replay/record/elementsScrollPositions.js.map +1 -1
- package/esm/domain/replay/record/index.js.map +1 -1
- package/esm/domain/replay/record/mutationBatch.js +541 -25
- package/esm/domain/replay/record/mutationBatch.js.map +1 -1
- package/esm/domain/replay/record/mutationObserver.js +1892 -195
- package/esm/domain/replay/record/mutationObserver.js.map +1 -1
- package/esm/domain/replay/record/mutationResourceBudget.js +137 -0
- package/esm/domain/replay/record/mutationResourceBudget.js.map +1 -0
- package/esm/domain/replay/record/observers.js +224 -55
- package/esm/domain/replay/record/observers.js.map +1 -1
- package/esm/domain/replay/record/privacy.js +30 -7
- package/esm/domain/replay/record/privacy.js.map +1 -1
- package/esm/domain/replay/record/record.js +3086 -325
- package/esm/domain/replay/record/record.js.map +1 -1
- package/esm/domain/replay/record/serializationUtils.js +422 -25
- package/esm/domain/replay/record/serializationUtils.js.map +1 -1
- package/esm/domain/replay/record/serialize.js +258 -50
- package/esm/domain/replay/record/serialize.js.map +1 -1
- package/esm/domain/replay/record/shadowRootsController.js +875 -21
- package/esm/domain/replay/record/shadowRootsController.js.map +1 -1
- package/esm/domain/replay/record/utils.js.map +1 -1
- package/esm/domain/replay/record/viewports.js.map +1 -1
- package/esm/domain/replay/replayStats.js.map +1 -1
- package/esm/domain/replay/segmentCollection/buildReplayPayload.js.map +1 -1
- package/esm/domain/replay/segmentCollection/index.js.map +1 -1
- package/esm/domain/replay/segmentCollection/segment.js +315 -10
- package/esm/domain/replay/segmentCollection/segment.js.map +1 -1
- package/esm/domain/replay/segmentCollection/segmentCollection.js +957 -72
- package/esm/domain/replay/segmentCollection/segmentCollection.js.map +1 -1
- package/esm/domain/replay/startRecordBridge.js.map +1 -1
- package/esm/domain/requestCollection.js.map +1 -1
- package/esm/domain/rumEventsCollection/actions/actionCollection.js.map +1 -1
- package/esm/domain/rumEventsCollection/actions/clickChain.js.map +1 -1
- package/esm/domain/rumEventsCollection/actions/computeFrustration.js.map +1 -1
- package/esm/domain/rumEventsCollection/actions/getActionNameFromElement.js.map +1 -1
- package/esm/domain/rumEventsCollection/actions/getSelectorsFromElement.js.map +1 -1
- package/esm/domain/rumEventsCollection/actions/interactionSelectorCache.js.map +1 -1
- package/esm/domain/rumEventsCollection/actions/listenActionEvents.js.map +1 -1
- package/esm/domain/rumEventsCollection/actions/trackClickActions.js.map +1 -1
- package/esm/domain/rumEventsCollection/error/errorCollection.js.map +1 -1
- package/esm/domain/rumEventsCollection/error/trackConsoleError.js.map +1 -1
- package/esm/domain/rumEventsCollection/error/trackReportError.js.map +1 -1
- package/esm/domain/rumEventsCollection/longTask/longAnimationFrameCollection.js.map +1 -1
- package/esm/domain/rumEventsCollection/longTask/longTaskCollection.js.map +1 -1
- package/esm/domain/rumEventsCollection/resource/matchRequestResourceEntry.js.map +1 -1
- package/esm/domain/rumEventsCollection/resource/resourceCollection.js +55 -0
- package/esm/domain/rumEventsCollection/resource/resourceCollection.js.map +1 -1
- package/esm/domain/rumEventsCollection/resource/resourceTrackerManager.js.map +1 -1
- package/esm/domain/rumEventsCollection/resource/resourceUtils.js.map +1 -1
- package/esm/domain/rumEventsCollection/resource/retrieveInitialDocumentResourceTiming.js.map +1 -1
- package/esm/domain/rumEventsCollection/resource/webSocketCollection.js +189 -0
- package/esm/domain/rumEventsCollection/resource/webSocketCollection.js.map +1 -0
- package/esm/domain/rumEventsCollection/view/interactionCountPolyfill.js.map +1 -1
- package/esm/domain/rumEventsCollection/view/trackCommonViewMetrics.js.map +1 -1
- package/esm/domain/rumEventsCollection/view/trackCumulativeLayoutShift.js.map +1 -1
- package/esm/domain/rumEventsCollection/view/trackFirstContentfulPaint.js.map +1 -1
- package/esm/domain/rumEventsCollection/view/trackFirstHidden.js.map +1 -1
- package/esm/domain/rumEventsCollection/view/trackFirstInput.js.map +1 -1
- package/esm/domain/rumEventsCollection/view/trackInitialViewTimings.js.map +1 -1
- package/esm/domain/rumEventsCollection/view/trackInteractionToNextPaint.js.map +1 -1
- package/esm/domain/rumEventsCollection/view/trackLargestContentfulPaint.js.map +1 -1
- package/esm/domain/rumEventsCollection/view/trackLoadingTime.js +8 -3
- package/esm/domain/rumEventsCollection/view/trackLoadingTime.js.map +1 -1
- package/esm/domain/rumEventsCollection/view/trackNavigationTimings.js.map +1 -1
- package/esm/domain/rumEventsCollection/view/trackScrollMetrics.js.map +1 -1
- package/esm/domain/rumEventsCollection/view/trackViewEventCounts.js.map +1 -1
- package/esm/domain/rumEventsCollection/view/trackViews.js +32 -13
- package/esm/domain/rumEventsCollection/view/trackViews.js.map +1 -1
- package/esm/domain/rumEventsCollection/view/viewCollection.js.map +1 -1
- package/esm/domain/rumSessionManager.js +24 -4
- package/esm/domain/rumSessionManager.js.map +1 -1
- package/esm/domain/tracing/ddtraceTracer.js.map +1 -1
- package/esm/domain/tracing/getDocumentTraceId.js.map +1 -1
- package/esm/domain/tracing/jaegerTracer.js.map +1 -1
- package/esm/domain/tracing/sampler.js.map +1 -1
- package/esm/domain/tracing/skywalkingTracer.js.map +1 -1
- package/esm/domain/tracing/traceIdentifier.js.map +1 -1
- package/esm/domain/tracing/tracer.js +2 -2
- package/esm/domain/tracing/tracer.js.map +1 -1
- package/esm/domain/tracing/w3cTraceParentTracer.js.map +1 -1
- package/esm/domain/tracing/zipkinMultiTracer.js.map +1 -1
- package/esm/domain/tracing/zipkinSingleTracer.js.map +1 -1
- package/esm/domain/trackEventCounts.js.map +1 -1
- package/esm/domain/usr/index.js.map +1 -1
- package/esm/domain/waitPageActivityEnd.js.map +1 -1
- package/esm/index.js.map +1 -1
- package/esm/transport/startRumBatch.js +4 -2
- package/esm/transport/startRumBatch.js.map +1 -1
- package/esm/transport/startRumEventBridge.js.map +1 -1
- package/esm/types/index.js.map +1 -1
- package/esm/types/sessionReplayConstants.js.map +1 -1
- package/package.json +12 -7
- package/src/boot/perStartRum.js +47 -7
- package/src/boot/recorderApi.js +271 -220
- package/src/boot/recorderApiStub.js +3 -29
- package/src/boot/rum.js +11 -0
- package/src/boot/rumPublicApi.js +38 -3
- package/src/boot/sessionReplayPublicApi.js +15 -28
- package/src/boot/startRecording.js +429 -146
- package/src/domain/assembly.js +5 -4
- package/src/domain/configuration.js +76 -101
- package/src/domain/contexts/urlContexts.js +29 -3
- package/src/domain/contexts/viewContexts.js +2 -2
- package/src/domain/deflate/deflateEncoder.js +699 -43
- package/src/domain/deflate/deflateWorker.js +237 -136
- package/src/domain/plugins.js +94 -0
- package/src/domain/replay/record/canvasCommandCapture.js +1374 -180
- package/src/domain/replay/record/canvasCommandObserver.js +1585 -150
- package/src/domain/replay/record/canvasCommandSerializeArgs.js +79 -42
- package/src/domain/replay/record/canvasContext.js +67 -0
- package/src/domain/replay/record/canvasContinuousScheduler.js +379 -143
- package/src/domain/replay/record/canvasEncodeBridge.js +691 -106
- package/src/domain/replay/record/canvasEncodeWorker.js +67 -43
- package/src/domain/replay/record/canvasFrameSignature.js +58 -24
- package/src/domain/replay/record/canvasObserver.js +461 -89
- package/src/domain/replay/record/canvasWebGLPluginHost.js +43 -0
- package/src/domain/replay/record/elementsScrollPositions.js +3 -0
- package/src/domain/replay/record/mutationBatch.js +761 -27
- package/src/domain/replay/record/mutationObserver.js +2992 -261
- package/src/domain/replay/record/mutationResourceBudget.js +191 -0
- package/src/domain/replay/record/observers.js +367 -97
- package/src/domain/replay/record/privacy.js +34 -12
- package/src/domain/replay/record/record.js +4284 -413
- package/src/domain/replay/record/serializationUtils.js +587 -28
- package/src/domain/replay/record/serialize.js +432 -66
- package/src/domain/replay/record/shadowRootsController.js +1108 -30
- package/src/domain/replay/segmentCollection/segment.js +441 -11
- package/src/domain/replay/segmentCollection/segmentCollection.js +1300 -77
- package/src/domain/rumEventsCollection/resource/resourceCollection.js +70 -0
- package/src/domain/rumEventsCollection/resource/webSocketCollection.js +271 -0
- package/src/domain/rumEventsCollection/view/trackLoadingTime.js +12 -3
- package/src/domain/rumEventsCollection/view/trackViews.js +38 -13
- package/src/domain/rumSessionManager.js +33 -2
- package/src/domain/tracing/tracer.js +4 -5
- package/src/transport/startRumBatch.js +6 -1
- package/types/index.d.ts +100 -8
- package/cjs/domain/replay/record/canvasReplayFixtures.js +0 -105
- package/cjs/domain/replay/record/canvasReplayFixtures.js.map +0 -1
- package/esm/domain/replay/record/canvasReplayFixtures.js +0 -96
- package/esm/domain/replay/record/canvasReplayFixtures.js.map +0 -1
- package/src/domain/replay/record/canvasReplayFixtures.js +0 -113
|
@@ -2,6 +2,7 @@ import {
|
|
|
2
2
|
timeStampNow,
|
|
3
3
|
createHttpRequest,
|
|
4
4
|
LifeCycleEventType,
|
|
5
|
+
PageExitReason,
|
|
5
6
|
addTelemetryDebug,
|
|
6
7
|
ONE_SECOND,
|
|
7
8
|
canUseEventBridge,
|
|
@@ -18,18 +19,89 @@ import { deleteOldestStats } from '../domain/replay/replayStats'
|
|
|
18
19
|
/* How long to wait for error checkouts */
|
|
19
20
|
export const BUFFER_CHECKOUT_TIME = 60 * ONE_SECOND
|
|
20
21
|
var REPLAY_SEGMENT_FLUSH_HISTORY_LIMIT = 10
|
|
22
|
+
|
|
21
23
|
export function startRecording(
|
|
22
24
|
lifeCycle,
|
|
23
25
|
configuration,
|
|
24
26
|
sessionManager,
|
|
25
27
|
viewContexts,
|
|
26
28
|
encoder,
|
|
27
|
-
httpRequest
|
|
29
|
+
httpRequest,
|
|
30
|
+
onStopped,
|
|
31
|
+
createHttpRequestOverride,
|
|
32
|
+
recordOverride
|
|
28
33
|
) {
|
|
34
|
+
var createHttpRequestImpl = __BUILD_ENV__REPLAY_DEBUG_ENABLED__
|
|
35
|
+
? createHttpRequestOverride || createHttpRequest
|
|
36
|
+
: createHttpRequest
|
|
37
|
+
var recordImpl = __BUILD_ENV__REPLAY_DEBUG_ENABLED__
|
|
38
|
+
? recordOverride || record
|
|
39
|
+
: record
|
|
29
40
|
var cleanupTasks = []
|
|
41
|
+
var isRecordingStopped = false
|
|
42
|
+
var isRecordingReady = false
|
|
43
|
+
var pendingStopRequested = false
|
|
44
|
+
var pendingStopReason
|
|
45
|
+
var stoppedNotificationSent = false
|
|
46
|
+
var flushRecorderBeforePageExit = function () {}
|
|
47
|
+
var replayResetRequestedBeforeRecorder = false
|
|
48
|
+
var requestReplayReset = function () {
|
|
49
|
+
replayResetRequestedBeforeRecorder = true
|
|
50
|
+
}
|
|
51
|
+
function notifyStopped(flushReason) {
|
|
52
|
+
if (stoppedNotificationSent || !onStopped) {
|
|
53
|
+
return
|
|
54
|
+
}
|
|
55
|
+
stoppedNotificationSent = true
|
|
56
|
+
try {
|
|
57
|
+
onStopped(flushReason)
|
|
58
|
+
} catch (error) {
|
|
59
|
+
addTelemetryDebug('Session Replay stopped callback failed.', {
|
|
60
|
+
reason: flushReason,
|
|
61
|
+
error: String(error)
|
|
62
|
+
})
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
function stopRecording(flushReason) {
|
|
66
|
+
if (isRecordingStopped) {
|
|
67
|
+
return
|
|
68
|
+
}
|
|
69
|
+
if (!isRecordingReady) {
|
|
70
|
+
pendingStopRequested = true
|
|
71
|
+
pendingStopReason = flushReason
|
|
72
|
+
return
|
|
73
|
+
}
|
|
74
|
+
isRecordingStopped = true
|
|
75
|
+
var firstCleanupError
|
|
76
|
+
cleanupTasks
|
|
77
|
+
.slice()
|
|
78
|
+
.reverse()
|
|
79
|
+
.forEach(function (task) {
|
|
80
|
+
try {
|
|
81
|
+
task(flushReason)
|
|
82
|
+
} catch (error) {
|
|
83
|
+
if (!firstCleanupError) {
|
|
84
|
+
firstCleanupError = error
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
})
|
|
88
|
+
if (firstCleanupError) {
|
|
89
|
+
addTelemetryDebug('Session Replay cleanup failed.', {
|
|
90
|
+
reason: flushReason,
|
|
91
|
+
error: String(firstCleanupError)
|
|
92
|
+
})
|
|
93
|
+
}
|
|
94
|
+
notifyStopped(flushReason)
|
|
95
|
+
}
|
|
30
96
|
var lastReplaySegmentFlushForDebug
|
|
31
|
-
var replaySegmentFlushHistoryForDebug =
|
|
97
|
+
var replaySegmentFlushHistoryForDebug =
|
|
98
|
+
__BUILD_ENV__REPLAY_DEBUG_ENABLED__ ? [] : undefined
|
|
32
99
|
var replaySegmentFlushCount = 0
|
|
100
|
+
var replayResetCountForDebug = 0
|
|
101
|
+
var replayResetLastReasonForDebug
|
|
102
|
+
var areReplaySegmentsLockedForDebug = function () {
|
|
103
|
+
return false
|
|
104
|
+
}
|
|
33
105
|
var reportError = function (error) {
|
|
34
106
|
lifeCycle.notify(LifeCycleEventType.RAW_ERROR_COLLECTED, { error: error })
|
|
35
107
|
addTelemetryDebug('Error reported to customer', {
|
|
@@ -37,167 +109,369 @@ export function startRecording(
|
|
|
37
109
|
})
|
|
38
110
|
}
|
|
39
111
|
|
|
40
|
-
|
|
41
|
-
httpRequest ||
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
112
|
+
try {
|
|
113
|
+
var replayRequest = httpRequest || lifeCycle.$rReplayRequest
|
|
114
|
+
if (!replayRequest) {
|
|
115
|
+
replayRequest = createHttpRequestImpl(
|
|
116
|
+
configuration.sessionReplayEndPoint,
|
|
117
|
+
SEGMENT_BYTES_LIMIT,
|
|
118
|
+
configuration.retryMaxSize,
|
|
119
|
+
reportError
|
|
120
|
+
)
|
|
121
|
+
// Recorder restarts share one bounded retry queue/timer/request state.
|
|
122
|
+
// Old segment finishes can then drain in order without multiplying a
|
|
123
|
+
// 20 MiB queue for every stop/start cycle.
|
|
124
|
+
lifeCycle.$rReplayRequest = replayRequest
|
|
125
|
+
}
|
|
48
126
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
127
|
+
let addRecord, addBaselineRecords, _record
|
|
128
|
+
var stopSegmentCollection
|
|
129
|
+
var beginMandatoryFullSnapshotRecovery = function () {}
|
|
130
|
+
var discardMandatoryFullSnapshotRecovery = function () {}
|
|
131
|
+
var wasLastEmitBackpressured = function () {}
|
|
132
|
+
if (!canUseEventBridge()) {
|
|
133
|
+
const session = sessionManager.findTrackedSession()
|
|
134
|
+
let isRecordErrorSessionReplay =
|
|
135
|
+
session && session.errorSessionReplayAllowed && !session.sessionHasError
|
|
136
|
+
var segmentCollection = startSegmentCollection(
|
|
137
|
+
lifeCycle,
|
|
138
|
+
configuration,
|
|
139
|
+
sessionManager,
|
|
140
|
+
viewContexts,
|
|
141
|
+
replayRequest,
|
|
142
|
+
encoder,
|
|
143
|
+
isRecordErrorSessionReplay,
|
|
144
|
+
{
|
|
145
|
+
beforePageExitFlush: function (pageExitEvent) {
|
|
146
|
+
flushRecorderBeforePageExit(pageExitEvent)
|
|
147
|
+
},
|
|
148
|
+
onReplayResetNeeded: function (reason) {
|
|
149
|
+
if (__BUILD_ENV__REPLAY_DEBUG_ENABLED__) {
|
|
150
|
+
replayResetCountForDebug += 1
|
|
151
|
+
replayResetLastReasonForDebug = reason
|
|
152
|
+
}
|
|
153
|
+
requestReplayReset(reason)
|
|
154
|
+
},
|
|
155
|
+
onReplayResetExhausted: function (reason) {
|
|
156
|
+
stopRecording(reason || 'full_snapshot_failure_limit')
|
|
157
|
+
},
|
|
158
|
+
onSegmentFlushed: __BUILD_ENV__REPLAY_DEBUG_ENABLED__
|
|
159
|
+
? function (segmentFlush) {
|
|
160
|
+
replaySegmentFlushCount += 1
|
|
161
|
+
lastReplaySegmentFlushForDebug =
|
|
162
|
+
cloneReplaySegmentFlushForDebug(
|
|
163
|
+
segmentFlush,
|
|
164
|
+
replaySegmentFlushCount
|
|
165
|
+
)
|
|
166
|
+
replaySegmentFlushHistoryForDebug.push(
|
|
167
|
+
lastReplaySegmentFlushForDebug
|
|
168
|
+
)
|
|
169
|
+
if (
|
|
170
|
+
replaySegmentFlushHistoryForDebug.length >
|
|
171
|
+
REPLAY_SEGMENT_FLUSH_HISTORY_LIMIT
|
|
172
|
+
) {
|
|
173
|
+
replaySegmentFlushHistoryForDebug.shift()
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
: undefined
|
|
77
177
|
}
|
|
178
|
+
)
|
|
179
|
+
addRecord = segmentCollection.addRecord
|
|
180
|
+
addBaselineRecords = segmentCollection.$rAddBaselineRecords
|
|
181
|
+
wasLastEmitBackpressured =
|
|
182
|
+
segmentCollection.$rWasLastAddRecordBackpressured ||
|
|
183
|
+
wasLastEmitBackpressured
|
|
184
|
+
beginMandatoryFullSnapshotRecovery =
|
|
185
|
+
segmentCollection.$rBeginMandatoryRecovery ||
|
|
186
|
+
beginMandatoryFullSnapshotRecovery
|
|
187
|
+
discardMandatoryFullSnapshotRecovery =
|
|
188
|
+
segmentCollection.$rDiscardMandatoryRecovery ||
|
|
189
|
+
discardMandatoryFullSnapshotRecovery
|
|
190
|
+
let flushBufferSegment = segmentCollection.flushBufferSegment
|
|
191
|
+
let unlockSegment = segmentCollection.unlockSegment
|
|
192
|
+
if (__BUILD_ENV__REPLAY_DEBUG_ENABLED__) {
|
|
193
|
+
areReplaySegmentsLockedForDebug = segmentCollection.isLocked
|
|
78
194
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
195
|
+
stopSegmentCollection = segmentCollection.stop
|
|
196
|
+
// Register a provisional cleanup before record() starts. Unexpected
|
|
197
|
+
// recorder initialization failures must not leave segment lifecycle
|
|
198
|
+
// subscriptions and timers alive.
|
|
199
|
+
cleanupTasks.push(stopSegmentCollection)
|
|
200
|
+
if (isRecordErrorSessionReplay) {
|
|
201
|
+
var sessionStateUpdateSubscription =
|
|
202
|
+
sessionManager.sessionStateUpdateObservable.subscribe(
|
|
203
|
+
({ previousState, newState }) => {
|
|
204
|
+
if (!previousState.hasError && newState.hasError) {
|
|
205
|
+
isRecordErrorSessionReplay = false
|
|
206
|
+
unlockSegment()
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
)
|
|
210
|
+
cleanupTasks.push(sessionStateUpdateSubscription.unsubscribe)
|
|
211
|
+
}
|
|
212
|
+
let lastFullSnapshotEvent = null
|
|
213
|
+
const wrappedEmit = (recordData) => {
|
|
214
|
+
const accepted = addRecord(recordData)
|
|
215
|
+
if (accepted !== false && isRecordErrorSessionReplay) {
|
|
216
|
+
if (recordData.type === RecordType.FullSnapshot) {
|
|
217
|
+
lastFullSnapshotEvent = recordData
|
|
218
|
+
} else if (recordData.type === RecordType.IncrementalSnapshot) {
|
|
219
|
+
const exceedTime =
|
|
220
|
+
recordData.timestamp - lastFullSnapshotEvent.timestamp >
|
|
221
|
+
BUFFER_CHECKOUT_TIME
|
|
222
|
+
// If the time between the last full snapshot and the incremental snapshot is greater than the buffer time, we need to take a new full snapshot
|
|
223
|
+
if (exceedTime) {
|
|
224
|
+
flushBufferSegment(() => {
|
|
225
|
+
deleteOldestStats()
|
|
226
|
+
takeSubsequentFullSnapshot()
|
|
227
|
+
})
|
|
228
|
+
}
|
|
90
229
|
}
|
|
91
230
|
}
|
|
231
|
+
return accepted
|
|
232
|
+
}
|
|
233
|
+
const wrappedEmitBaseline = (records) => {
|
|
234
|
+
const accepted = addBaselineRecords(records)
|
|
235
|
+
if (accepted !== false && isRecordErrorSessionReplay) {
|
|
236
|
+
lastFullSnapshotEvent = records[records.length - 1]
|
|
237
|
+
}
|
|
238
|
+
return accepted
|
|
239
|
+
}
|
|
240
|
+
_record = recordImpl({
|
|
241
|
+
emit: wrappedEmit,
|
|
242
|
+
$rEmitBaseline: wrappedEmitBaseline,
|
|
243
|
+
configuration: configuration,
|
|
244
|
+
lifeCycle: lifeCycle,
|
|
245
|
+
sessionManager: sessionManager,
|
|
246
|
+
$rWasLastEmitBackpressured: wasLastEmitBackpressured,
|
|
247
|
+
$rOnMandatoryFullSnapshotStarted:
|
|
248
|
+
beginMandatoryFullSnapshotRecovery,
|
|
249
|
+
$rOnMandatoryFullSnapshotAbandoned:
|
|
250
|
+
discardMandatoryFullSnapshotRecovery,
|
|
251
|
+
onFullSnapshotFailure: stopRecording
|
|
252
|
+
})
|
|
253
|
+
} else {
|
|
254
|
+
;({ addRecord } = startRecordBridge(viewContexts))
|
|
255
|
+
_record = recordImpl({
|
|
256
|
+
emit: addRecord,
|
|
257
|
+
configuration: configuration,
|
|
258
|
+
lifeCycle: lifeCycle,
|
|
259
|
+
sessionManager: sessionManager,
|
|
260
|
+
$rWasLastEmitBackpressured: wasLastEmitBackpressured,
|
|
261
|
+
$rOnMandatoryFullSnapshotStarted:
|
|
262
|
+
beginMandatoryFullSnapshotRecovery,
|
|
263
|
+
$rOnMandatoryFullSnapshotAbandoned:
|
|
264
|
+
discardMandatoryFullSnapshotRecovery,
|
|
265
|
+
onFullSnapshotFailure: stopRecording
|
|
266
|
+
})
|
|
267
|
+
}
|
|
268
|
+
if (!_record || typeof _record.stop !== 'function') {
|
|
269
|
+
throw new Error('Session Replay recorder failed to initialize.')
|
|
270
|
+
}
|
|
271
|
+
var stopRecorder = _record.stop
|
|
272
|
+
if (stopSegmentCollection) {
|
|
273
|
+
// Remove the provisional entry and restore the intended successful-stop
|
|
274
|
+
// ordering below (cleanup tasks run in reverse).
|
|
275
|
+
var provisionalCleanupIndex = cleanupTasks.indexOf(
|
|
276
|
+
stopSegmentCollection
|
|
92
277
|
)
|
|
278
|
+
if (provisionalCleanupIndex !== -1) {
|
|
279
|
+
cleanupTasks.splice(provisionalCleanupIndex, 1)
|
|
280
|
+
}
|
|
93
281
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
const exceedTime =
|
|
102
|
-
recordData.timestamp - lastFullSnapshotEvent.timestamp >
|
|
103
|
-
BUFFER_CHECKOUT_TIME
|
|
104
|
-
// If the time between the last full snapshot and the incremental snapshot is greater than the buffer time, we need to take a new full snapshot
|
|
105
|
-
if (exceedTime) {
|
|
106
|
-
flushBufferSegment(() => {
|
|
107
|
-
deleteOldestStats()
|
|
108
|
-
takeSubsequentFullSnapshot()
|
|
109
|
-
})
|
|
282
|
+
cleanupTasks.push(
|
|
283
|
+
stopSegmentCollection
|
|
284
|
+
? function (flushReason) {
|
|
285
|
+
// segmentCollection already invoked beforePageExitFlush while its
|
|
286
|
+
// encoder was writable. Teardown must now discard any unfinished
|
|
287
|
+
// atomic tail instead of doing work that can no longer be sent.
|
|
288
|
+
stopRecorder(flushReason, true)
|
|
110
289
|
}
|
|
111
|
-
|
|
290
|
+
: stopRecorder
|
|
291
|
+
)
|
|
292
|
+
if (stopSegmentCollection) {
|
|
293
|
+
// Stop the segment collection first (cleanup tasks run in reverse).
|
|
294
|
+
// Its beforePageExitFlush hook can then drain the still-live recorder,
|
|
295
|
+
// including a second unload pass after synchronous encoder backpressure
|
|
296
|
+
// is released, before the observers are torn down.
|
|
297
|
+
cleanupTasks.push(stopSegmentCollection)
|
|
298
|
+
}
|
|
299
|
+
var takeSubsequentFullSnapshot = _record.takeSubsequentFullSnapshot
|
|
300
|
+
var flushScheduledFullSnapshot =
|
|
301
|
+
_record.flushScheduledFullSnapshot || function () {}
|
|
302
|
+
var flushCanvasCommands =
|
|
303
|
+
_record.$rFlushCanvasCommands || function () {}
|
|
304
|
+
flushRecorderBeforePageExit = function (pageExitEvent) {
|
|
305
|
+
if (
|
|
306
|
+
pageExitEvent &&
|
|
307
|
+
pageExitEvent.reason !== PageExitReason.UNLOADING
|
|
308
|
+
) {
|
|
309
|
+
// Hidden, frozen, and pagehide states can resume in the same view.
|
|
310
|
+
// Keep an in-progress DOM recovery baseline scheduled so later
|
|
311
|
+
// mutations are never attached to the stale pre-overflow snapshot.
|
|
312
|
+
_record.flushMutations()
|
|
313
|
+
flushCanvasCommands()
|
|
314
|
+
return
|
|
112
315
|
}
|
|
316
|
+
if (!flushScheduledFullSnapshot()) {
|
|
317
|
+
// The segment is still writable in this hook. Give a paged raw/shadow
|
|
318
|
+
// transaction its final bounded drain before segmentCollection closes;
|
|
319
|
+
// record.stop() runs afterwards and can only discard an unfinished
|
|
320
|
+
// atomic tail.
|
|
321
|
+
_record.flushMutations(true)
|
|
322
|
+
}
|
|
323
|
+
// Keep the command recorder alive until this hook runs: the segment is
|
|
324
|
+
// still writable here, including the second unload pass after synchronous
|
|
325
|
+
// encoder backpressure is released.
|
|
326
|
+
flushCanvasCommands()
|
|
113
327
|
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
lifeCycle: lifeCycle,
|
|
118
|
-
sessionManager: sessionManager
|
|
119
|
-
})
|
|
120
|
-
} else {
|
|
121
|
-
;({ addRecord } = startRecordBridge(viewContexts))
|
|
122
|
-
_record = record({
|
|
123
|
-
emit: addRecord,
|
|
124
|
-
configuration: configuration,
|
|
125
|
-
lifeCycle: lifeCycle,
|
|
126
|
-
sessionManager: sessionManager
|
|
127
|
-
})
|
|
128
|
-
}
|
|
129
|
-
cleanupTasks.push(_record.stop)
|
|
130
|
-
var takeSubsequentFullSnapshot = _record.takeSubsequentFullSnapshot
|
|
131
|
-
var snapshotCanvas = _record.snapshotCanvas
|
|
132
|
-
var getSerializedNodeIdForDebug = _record.getSerializedNodeIdForDebug
|
|
133
|
-
var getLastAutoCanvasSnapshotResultForDebug =
|
|
134
|
-
_record.getLastAutoCanvasSnapshotResultForDebug
|
|
135
|
-
var getAutoCanvasSnapshotDebugHistoryForDebug =
|
|
136
|
-
_record.getAutoCanvasSnapshotDebugHistoryForDebug
|
|
137
|
-
var getLastCanvasMutationForDebug = _record.getLastCanvasMutationForDebug
|
|
138
|
-
var getCanvasMutationHistoryForDebug =
|
|
139
|
-
_record.getCanvasMutationHistoryForDebug
|
|
140
|
-
var getLastDomMutationForDebug = _record.getLastDomMutationForDebug
|
|
141
|
-
var getDomMutationHistoryForDebug = _record.getDomMutationHistoryForDebug
|
|
142
|
-
var getReplayPerformanceForDebug = function () {
|
|
143
|
-
return cloneReplayPerformanceForDebug(
|
|
144
|
-
_record.getReplayPerformanceForDebug
|
|
145
|
-
? _record.getReplayPerformanceForDebug()
|
|
146
|
-
: undefined,
|
|
147
|
-
replaySegmentFlushCount
|
|
328
|
+
requestReplayReset = createReplayResetScheduler(
|
|
329
|
+
takeSubsequentFullSnapshot,
|
|
330
|
+
cleanupTasks
|
|
148
331
|
)
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
return cloneReplaySegmentFlushForDebug(lastReplaySegmentFlushForDebug)
|
|
152
|
-
}
|
|
153
|
-
var getReplaySegmentFlushHistoryForDebug = function () {
|
|
154
|
-
return replaySegmentFlushHistoryForDebug.map(function (segmentFlush) {
|
|
155
|
-
return cloneReplaySegmentFlushForDebug(segmentFlush)
|
|
156
|
-
})
|
|
157
|
-
}
|
|
158
|
-
var flushMutations = _record.flushMutations
|
|
159
|
-
var subscribeViewEnded = lifeCycle.subscribe(
|
|
160
|
-
LifeCycleEventType.VIEW_ENDED,
|
|
161
|
-
function () {
|
|
162
|
-
flushMutations()
|
|
163
|
-
addRecord({
|
|
164
|
-
timestamp: timeStampNow(),
|
|
165
|
-
type: RecordType.ViewEnd
|
|
166
|
-
})
|
|
332
|
+
if (replayResetRequestedBeforeRecorder) {
|
|
333
|
+
requestReplayReset()
|
|
167
334
|
}
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
335
|
+
var scheduleSubsequentFullSnapshot =
|
|
336
|
+
_record.scheduleSubsequentFullSnapshot || takeSubsequentFullSnapshot
|
|
337
|
+
var prepareForViewChange =
|
|
338
|
+
_record.prepareForViewChange || _record.flushMutations
|
|
339
|
+
var snapshotCanvas = _record.snapshotCanvas
|
|
340
|
+
var getSerializedNodeIdForDebug = _record.getSerializedNodeIdForDebug
|
|
341
|
+
var recordingDebug
|
|
342
|
+
if (__BUILD_ENV__REPLAY_DEBUG_ENABLED__) {
|
|
343
|
+
recordingDebug = {
|
|
344
|
+
getLastAutoCanvasSnapshotResultForDebug:
|
|
345
|
+
_record.getLastAutoCanvasSnapshotResultForDebug,
|
|
346
|
+
getAutoCanvasSnapshotDebugHistoryForDebug:
|
|
347
|
+
_record.getAutoCanvasSnapshotDebugHistoryForDebug,
|
|
348
|
+
getLastCanvasMutationForDebug:
|
|
349
|
+
_record.getLastCanvasMutationForDebug,
|
|
350
|
+
getCanvasMutationHistoryForDebug:
|
|
351
|
+
_record.getCanvasMutationHistoryForDebug,
|
|
352
|
+
getLastDomMutationForDebug: _record.getLastDomMutationForDebug,
|
|
353
|
+
getDomMutationHistoryForDebug:
|
|
354
|
+
_record.getDomMutationHistoryForDebug,
|
|
355
|
+
getReplayPerformanceForDebug: function () {
|
|
356
|
+
return cloneReplayPerformanceForDebug(
|
|
357
|
+
_record.getReplayPerformanceForDebug
|
|
358
|
+
? _record.getReplayPerformanceForDebug()
|
|
359
|
+
: undefined,
|
|
360
|
+
replaySegmentFlushCount,
|
|
361
|
+
replayResetCountForDebug,
|
|
362
|
+
replayResetLastReasonForDebug,
|
|
363
|
+
areReplaySegmentsLockedForDebug()
|
|
364
|
+
)
|
|
365
|
+
},
|
|
366
|
+
getLastReplaySegmentFlushForDebug: function () {
|
|
367
|
+
return cloneReplaySegmentFlushForDebug(
|
|
368
|
+
lastReplaySegmentFlushForDebug
|
|
369
|
+
)
|
|
370
|
+
},
|
|
371
|
+
getReplaySegmentFlushHistoryForDebug: function () {
|
|
372
|
+
return replaySegmentFlushHistoryForDebug.map(function (
|
|
373
|
+
segmentFlush
|
|
374
|
+
) {
|
|
375
|
+
return cloneReplaySegmentFlushForDebug(segmentFlush)
|
|
376
|
+
})
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
var flushMutations = _record.flushMutations
|
|
381
|
+
var subscribeViewEnded = lifeCycle.subscribe(
|
|
382
|
+
LifeCycleEventType.VIEW_ENDED,
|
|
383
|
+
function () {
|
|
384
|
+
if (!flushScheduledFullSnapshot(true, true)) {
|
|
385
|
+
// Preserve DOM changes still queued by the native MutationObservers.
|
|
386
|
+
// The next view snapshot has not been scheduled yet, so resetting the
|
|
387
|
+
// observers here would otherwise lose the old view's final state.
|
|
388
|
+
flushMutations()
|
|
389
|
+
}
|
|
390
|
+
// Canvas command batches are frame-scheduled. Publish the old view's
|
|
391
|
+
// final batch before ViewEnd and before VIEW_CREATED resets the canvas
|
|
392
|
+
// baseline for the next replay tree.
|
|
393
|
+
flushCanvasCommands()
|
|
394
|
+
prepareForViewChange()
|
|
395
|
+
addRecord({
|
|
396
|
+
timestamp: timeStampNow(),
|
|
397
|
+
type: RecordType.ViewEnd
|
|
398
|
+
})
|
|
399
|
+
}
|
|
400
|
+
)
|
|
401
|
+
cleanupTasks.push(subscribeViewEnded.unsubscribe)
|
|
402
|
+
var scribeViewCreated = lifeCycle.subscribe(
|
|
403
|
+
LifeCycleEventType.VIEW_CREATED,
|
|
404
|
+
function (view) {
|
|
405
|
+
scheduleSubsequentFullSnapshot(view.startClocks.timeStamp)
|
|
406
|
+
}
|
|
407
|
+
)
|
|
408
|
+
cleanupTasks.push(scribeViewCreated.unsubscribe)
|
|
409
|
+
isRecordingReady = true
|
|
410
|
+
if (pendingStopRequested) {
|
|
411
|
+
stopRecording(pendingStopReason)
|
|
174
412
|
}
|
|
175
|
-
)
|
|
176
|
-
|
|
413
|
+
} catch (error) {
|
|
414
|
+
isRecordingReady = true
|
|
415
|
+
stopRecording('start_failure')
|
|
416
|
+
throw error
|
|
417
|
+
}
|
|
177
418
|
|
|
178
|
-
|
|
179
|
-
stop:
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
419
|
+
var recording = {
|
|
420
|
+
stop: stopRecording,
|
|
421
|
+
isStopped: function () {
|
|
422
|
+
return isRecordingStopped
|
|
423
|
+
},
|
|
424
|
+
// The public/manual snapshot is opportunistic. Internal view, buffer and
|
|
425
|
+
// recovery snapshots keep using the raw non-discardable function above.
|
|
426
|
+
takeSubsequentFullSnapshot: function () {
|
|
427
|
+
return takeSubsequentFullSnapshot(undefined, true)
|
|
183
428
|
},
|
|
184
|
-
takeSubsequentFullSnapshot: takeSubsequentFullSnapshot,
|
|
185
429
|
snapshotCanvas: snapshotCanvas,
|
|
186
430
|
getSerializedNodeIdForDebug: getSerializedNodeIdForDebug,
|
|
187
|
-
getLastAutoCanvasSnapshotResultForDebug:
|
|
188
|
-
getLastAutoCanvasSnapshotResultForDebug,
|
|
189
|
-
getAutoCanvasSnapshotDebugHistoryForDebug:
|
|
190
|
-
getAutoCanvasSnapshotDebugHistoryForDebug,
|
|
191
|
-
getLastCanvasMutationForDebug: getLastCanvasMutationForDebug,
|
|
192
|
-
getCanvasMutationHistoryForDebug: getCanvasMutationHistoryForDebug,
|
|
193
|
-
getLastDomMutationForDebug: getLastDomMutationForDebug,
|
|
194
|
-
getDomMutationHistoryForDebug: getDomMutationHistoryForDebug,
|
|
195
|
-
getLastReplaySegmentFlushForDebug: getLastReplaySegmentFlushForDebug,
|
|
196
|
-
getReplaySegmentFlushHistoryForDebug:
|
|
197
|
-
getReplaySegmentFlushHistoryForDebug,
|
|
198
|
-
getReplayPerformanceForDebug: getReplayPerformanceForDebug,
|
|
199
431
|
flushReplayMutationsForDebug: flushMutations
|
|
200
432
|
}
|
|
433
|
+
if (__BUILD_ENV__REPLAY_DEBUG_ENABLED__) {
|
|
434
|
+
assign(recording, recordingDebug)
|
|
435
|
+
}
|
|
436
|
+
return recording
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
function createReplayResetScheduler(takeSubsequentFullSnapshot, cleanupTasks) {
|
|
440
|
+
var stopped = false
|
|
441
|
+
var pending = false
|
|
442
|
+
var lastResetAt = -Infinity
|
|
443
|
+
var resetTimeoutId
|
|
444
|
+
var RESET_MIN_INTERVAL = ONE_SECOND
|
|
445
|
+
|
|
446
|
+
function runReset() {
|
|
447
|
+
resetTimeoutId = undefined
|
|
448
|
+
if (stopped || !pending) {
|
|
449
|
+
return
|
|
450
|
+
}
|
|
451
|
+
pending = false
|
|
452
|
+
lastResetAt = Date.now()
|
|
453
|
+
takeSubsequentFullSnapshot()
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
cleanupTasks.push(function () {
|
|
457
|
+
stopped = true
|
|
458
|
+
if (resetTimeoutId !== undefined) {
|
|
459
|
+
clearTimeout(resetTimeoutId)
|
|
460
|
+
resetTimeoutId = undefined
|
|
461
|
+
}
|
|
462
|
+
})
|
|
463
|
+
|
|
464
|
+
return function () {
|
|
465
|
+
if (stopped) {
|
|
466
|
+
return
|
|
467
|
+
}
|
|
468
|
+
pending = true
|
|
469
|
+
if (resetTimeoutId !== undefined) {
|
|
470
|
+
return
|
|
471
|
+
}
|
|
472
|
+
var delay = Math.max(lastResetAt + RESET_MIN_INTERVAL - Date.now(), 0)
|
|
473
|
+
resetTimeoutId = setTimeout(runReset, delay)
|
|
474
|
+
}
|
|
201
475
|
}
|
|
202
476
|
|
|
203
477
|
function cloneReplaySegmentFlushForDebug(segmentFlush, sequence) {
|
|
@@ -218,12 +492,21 @@ function cloneReplaySegmentFlushForDebug(segmentFlush, sequence) {
|
|
|
218
492
|
}
|
|
219
493
|
}
|
|
220
494
|
|
|
221
|
-
function cloneReplayPerformanceForDebug(
|
|
495
|
+
function cloneReplayPerformanceForDebug(
|
|
496
|
+
stats,
|
|
497
|
+
replaySegmentFlushCount,
|
|
498
|
+
replayResetCount,
|
|
499
|
+
replayResetLastReason,
|
|
500
|
+
replaySegmentsLocked
|
|
501
|
+
) {
|
|
222
502
|
if (!stats && typeof replaySegmentFlushCount === 'undefined') {
|
|
223
503
|
return undefined
|
|
224
504
|
}
|
|
225
505
|
|
|
226
506
|
return assign({}, stats || {}, {
|
|
227
|
-
replaySegmentFlushCount: replaySegmentFlushCount || 0
|
|
507
|
+
replaySegmentFlushCount: replaySegmentFlushCount || 0,
|
|
508
|
+
replayResetCount: replayResetCount || 0,
|
|
509
|
+
replayResetLastReason: replayResetLastReason,
|
|
510
|
+
replaySegmentsLocked: Boolean(replaySegmentsLocked)
|
|
228
511
|
})
|
|
229
512
|
}
|
package/src/domain/assembly.js
CHANGED
|
@@ -43,10 +43,11 @@ export function startRumAssembly(
|
|
|
43
43
|
getCommonContext,
|
|
44
44
|
reportError
|
|
45
45
|
) {
|
|
46
|
-
modifiableFieldPathsByEvent[RumEventType.VIEW] =
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
modifiableFieldPathsByEvent[RumEventType.VIEW] = assign(
|
|
47
|
+
{},
|
|
48
|
+
USER_CUSTOMIZABLE_FIELD_PATHS,
|
|
49
|
+
VIEW_MODIFIABLE_FIELD_PATHS
|
|
50
|
+
)
|
|
50
51
|
modifiableFieldPathsByEvent[RumEventType.ERROR] = assign(
|
|
51
52
|
{
|
|
52
53
|
'error.message': 'string',
|