Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(replay): Consider more things as DOM mutations for dead clicks #13518

Merged
merged 2 commits into from
Aug 30, 2024
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
2 changes: 1 addition & 1 deletion .size-limit.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module.exports = [
path: 'packages/browser/build/npm/esm/index.js',
import: createImport('init', 'browserTracingIntegration', 'replayIntegration'),
gzip: true,
limit: '73 KB',
limit: '75 KB',
},
{
name: '@sentry/browser (incl. Tracing, Replay) - with treeshaking flags',
Expand Down
13 changes: 12 additions & 1 deletion packages/replay-internal/src/coreHandlers/handleClick.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,17 @@ type IncrementalMouseInteractionRecordingEvent = IncrementalRecordingEvent & {
data: { type: MouseInteractions; id: number };
};

/** Any IncrementalSource for rrweb that we interpret as a kind of mutation. */
const IncrementalMutationSources = new Set([
IncrementalSource.Mutation,
IncrementalSource.StyleSheetRule,
IncrementalSource.StyleDeclaration,
IncrementalSource.AdoptedStyleSheet,
IncrementalSource.CanvasMutation,
IncrementalSource.Selection,
IncrementalSource.MediaInteraction,
]);

/** Handle a click. */
export function handleClick(clickDetector: ReplayClickDetector, clickBreadcrumb: Breadcrumb, node: HTMLElement): void {
clickDetector.handleClick(clickBreadcrumb, node);
Expand Down Expand Up @@ -324,7 +335,7 @@ export function updateClickDetectorForRecordingEvent(clickDetector: ReplayClickD
}

const { source } = event.data;
if (source === IncrementalSource.Mutation) {
if (IncrementalMutationSources.has(source)) {
clickDetector.registerMutation(event.timestamp);
}

Expand Down
Loading