Skip to content

Commit

Permalink
Merge branch 'prerelease-v5' into bcaudan/v5-deprecated-config
Browse files Browse the repository at this point in the history
  • Loading branch information
bcaudan committed May 12, 2023
2 parents 93cd402 + 356499a commit 2cdddfc
Show file tree
Hide file tree
Showing 6 changed files with 149 additions and 287 deletions.
29 changes: 0 additions & 29 deletions packages/rum-core/src/domain/configuration.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,35 +302,6 @@ describe('validateAndBuildRumConfiguration', () => {
})
})

describe('trackFrustrations', () => {
it('defaults to false', () => {
expect(validateAndBuildRumConfiguration(DEFAULT_INIT_CONFIGURATION)!.trackFrustrations).toBeFalse()
})

it('the initialization parameter is set to provided value', () => {
expect(
validateAndBuildRumConfiguration({ ...DEFAULT_INIT_CONFIGURATION, trackFrustrations: true })!.trackFrustrations
).toBeTrue()
expect(
validateAndBuildRumConfiguration({ ...DEFAULT_INIT_CONFIGURATION, trackFrustrations: false })!.trackFrustrations
).toBeFalse()
})

it('the initialization parameter the provided value is cast to boolean', () => {
expect(
validateAndBuildRumConfiguration({ ...DEFAULT_INIT_CONFIGURATION, trackFrustrations: 'foo' as any })!
.trackFrustrations
).toBeTrue()
})

it('implies "trackUserInteractions"', () => {
expect(
validateAndBuildRumConfiguration({ ...DEFAULT_INIT_CONFIGURATION, trackFrustrations: true })!
.trackUserInteractions
).toBeTrue()
})
})

describe('trackViewsManually', () => {
it('defaults to false', () => {
expect(validateAndBuildRumConfiguration(DEFAULT_INIT_CONFIGURATION)!.trackViewsManually).toBeFalse()
Expand Down
8 changes: 1 addition & 7 deletions packages/rum-core/src/domain/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ export interface RumInitConfiguration extends InitConfiguration {

// action options
trackUserInteractions?: boolean | undefined
trackFrustrations?: boolean | undefined
actionNameAttribute?: string | undefined

// view options
Expand All @@ -64,7 +63,6 @@ export interface RumConfiguration extends Configuration {
oldPlansBehavior: boolean
sessionReplaySampleRate: number
trackUserInteractions: boolean
trackFrustrations: boolean
trackViewsManually: boolean
trackResources: boolean | undefined
trackLongTasks: boolean | undefined
Expand Down Expand Up @@ -121,8 +119,6 @@ export function validateAndBuildRumConfiguration(
return
}

const trackFrustrations = !!initConfiguration.trackFrustrations

return assign(
{
applicationId: initConfiguration.applicationId,
Expand All @@ -133,8 +129,7 @@ export function validateAndBuildRumConfiguration(
traceSampleRate: initConfiguration.traceSampleRate,
allowedTracingUrls,
excludedActivityUrls: initConfiguration.excludedActivityUrls ?? [],
trackUserInteractions: !!initConfiguration.trackUserInteractions || trackFrustrations,
trackFrustrations,
trackUserInteractions: !!initConfiguration.trackUserInteractions,
trackViewsManually: !!initConfiguration.trackViewsManually,
trackResources: initConfiguration.trackResources,
trackLongTasks: initConfiguration.trackLongTasks,
Expand Down Expand Up @@ -218,7 +213,6 @@ export function serializeRumConfiguration(configuration: RumInitConfiguration):
default_privacy_level: configuration.defaultPrivacyLevel,
use_excluded_activity_urls:
Array.isArray(configuration.excludedActivityUrls) && configuration.excludedActivityUrls.length > 0,
track_frustrations: configuration.trackFrustrations,
track_views_manually: configuration.trackViewsManually,
track_user_interactions: configuration.trackUserInteractions,
},
Expand Down
Loading

0 comments on commit 2cdddfc

Please sign in to comment.