Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,6 @@ describe('serializeRumConfiguration', () => {
trackViewsManually: true,
trackResources: true,
trackLongTasks: true,
trackBfcacheViews: true,
trackEarlyRequests: true,
remoteConfigurationId: '123',
remoteConfigurationProxy: 'config',
Expand Down Expand Up @@ -678,7 +677,6 @@ describe('serializeRumConfiguration', () => {
enable_privacy_for_action_name: false,
track_resources: true,
track_long_task: true,
track_bfcache_views: true,
track_early_requests: true,
use_worker_url: true,
compress_intake_requests: true,
Expand Down
11 changes: 0 additions & 11 deletions packages/rum-core/src/domain/configuration/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,14 +221,6 @@ export interface RumInitConfiguration extends InitConfiguration {
*/
trackViewsManually?: boolean | undefined

/**
* Enable the creation of dedicated views for pages restored from the Back-Forward cache.
*
* @category Data Collection
* @defaultValue false
*/
trackBfcacheViews?: boolean | undefined

/**
* Enables collection of resource events.
*
Expand Down Expand Up @@ -312,7 +304,6 @@ export interface RumConfiguration extends Configuration {
trackViewsManually: boolean
trackResources: boolean
trackLongTasks: boolean
trackBfcacheViews: boolean
trackEarlyRequests: boolean
subdomain?: string
traceContextInjection: TraceContextInjection
Expand Down Expand Up @@ -385,7 +376,6 @@ export function validateAndBuildRumConfiguration(
trackViewsManually: !!initConfiguration.trackViewsManually,
trackResources: !!(initConfiguration.trackResources ?? true),
trackLongTasks: !!(initConfiguration.trackLongTasks ?? true),
trackBfcacheViews: !!initConfiguration.trackBfcacheViews,
trackEarlyRequests: !!initConfiguration.trackEarlyRequests,
subdomain: initConfiguration.subdomain,
defaultPrivacyLevel: objectHasValue(DefaultPrivacyLevel, initConfiguration.defaultPrivacyLevel)
Expand Down Expand Up @@ -538,7 +528,6 @@ export function serializeRumConfiguration(configuration: RumInitConfiguration) {
track_user_interactions: configuration.trackUserInteractions,
track_resources: configuration.trackResources,
track_long_task: configuration.trackLongTasks,
track_bfcache_views: configuration.trackBfcacheViews,
track_early_requests: configuration.trackEarlyRequests,
plugins: configuration.plugins?.map((plugin) => ({
name: plugin.name,
Expand Down
2 changes: 1 addition & 1 deletion packages/rum-core/src/domain/view/trackViews.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1087,7 +1087,7 @@ describe('BFCache views', () => {
let viewTest: ViewTest

beforeEach(() => {
viewTest = setupViewTest({ lifeCycle, partialConfig: { trackBfcacheViews: true } })
viewTest = setupViewTest({ lifeCycle })

registerCleanupTask(() => {
viewTest.stop()
Expand Down
12 changes: 5 additions & 7 deletions packages/rum-core/src/domain/view/trackViews.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,11 @@ export function trackViews(
let locationChangeSubscription: Subscription
if (areViewsTrackedAutomatically) {
locationChangeSubscription = renewViewOnLocationChange(locationChangeObservable)
if (configuration.trackBfcacheViews) {
stopOnBFCacheRestore = onBFCacheRestore(configuration, (pageshowEvent) => {
currentView.end()
const startClocks = relativeToClocks(pageshowEvent.timeStamp as RelativeTime)
currentView = startNewView(ViewLoadingType.BF_CACHE, startClocks, undefined)
})
}
stopOnBFCacheRestore = onBFCacheRestore(configuration, (pageshowEvent) => {
currentView.end()
const startClocks = relativeToClocks(pageshowEvent.timeStamp as RelativeTime)
currentView = startNewView(ViewLoadingType.BF_CACHE, startClocks, undefined)
})
}

function startNewView(loadingType: ViewLoadingType, startClocks?: ClocksState, viewOptions?: ViewOptions) {
Expand Down