Skip to content
Merged
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
1 change: 0 additions & 1 deletion packages/core/src/tools/experimentalFeatures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export enum ExperimentalFeature {
USE_CHANGE_RECORDS = 'use_change_records',
USE_INCREMENTAL_CHANGE_RECORDS = 'use_incremental_change_records',
TOO_MANY_REQUESTS_INVESTIGATION = 'too_many_requests_investigation',
COMPOSED_PATH_SELECTOR = 'composed_path_selector',
TRACK_RESOURCE_HEADERS = 'track_resource_headers',
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ describe('trackClickActions', () => {
selector: '#button',
width: 100,
height: 100,
composedPathSelector: undefined,
composedPathSelector: jasmine.any(String),
},
position: { x: 50, y: 50 },
events: [domEvent],
Expand Down Expand Up @@ -702,7 +702,6 @@ describe('trackClickActions', () => {

describe('when composed path selector is enabled', () => {
it('should return a composed_path_selector', () => {
addExperimentalFeatures([ExperimentalFeature.COMPOSED_PATH_SELECTOR])
startClickActionsTracking()
emulateClick({
target: button,
Expand Down
15 changes: 2 additions & 13 deletions packages/rum-core/src/domain/action/trackClickActions.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
import type { Duration, ClocksState, TimeStamp } from '@datadog/browser-core'
import {
timeStampNow,
Observable,
timeStampToClocks,
relativeToClocks,
generateUUID,
isExperimentalFeatureEnabled,
ExperimentalFeature,
} from '@datadog/browser-core'
import { timeStampNow, Observable, timeStampToClocks, relativeToClocks, generateUUID } from '@datadog/browser-core'
import { isNodeShadowHost } from '../../browser/htmlDomUtils'
import type { FrustrationType } from '../../rawRumEvent.types'
import { ActionType } from '../../rawRumEvent.types'
Expand Down Expand Up @@ -246,10 +238,7 @@ function computeClickActionBase(
const rect = target.getBoundingClientRect()
const selector = getSelectorFromElement(target, configuration.actionNameAttribute)

const composedPathSelector =
isExperimentalFeatureEnabled(ExperimentalFeature.COMPOSED_PATH_SELECTOR) && typeof event.composedPath === 'function'
? getComposedPathSelector(event.composedPath(), configuration.actionNameAttribute)
: undefined
const composedPathSelector = getComposedPathSelector(event.composedPath(), configuration.actionNameAttribute)

if (selector) {
updateInteractionSelector(event.timeStamp, selector)
Expand Down
15 changes: 0 additions & 15 deletions test/e2e/scenario/rum/actions.scenario.ts
Original file line number Diff line number Diff line change
Expand Up @@ -783,21 +783,6 @@ test.describe('custom actions with startAction/stopAction', () => {
})

test.describe('action collection with composed path selector', () => {
createTest('should not return a composed_path_selector if flag is disabled')
.withRum({ trackUserInteractions: true })
.withBody(html`
<button>Click</button>
<button id="my-button" data-test-allowed="test-btn" data-random="secret" class="foo bar baz">Click me</button>
`)
.run(async ({ intakeRegistry, flushEvents, page }) => {
const button = page.locator('#my-button')
await button.click()
await flushEvents()

const actionEvents = intakeRegistry.rumActionEvents
expect(actionEvents).toHaveLength(1)
expect(actionEvents[0]._dd.action?.target?.composed_path_selector).toBeUndefined()
})
createTest('should return a composed_path_selector if flag is enabled')
.withRum({
trackUserInteractions: true,
Expand Down
Loading