fix(autocapture): prevent scroll gestures from triggering dead clicks - #1941
Merged
Conversation
Contributor
Contributor
Author
|
bugbot run |
size-limit report 📦
|
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit b22f96d. Configure here.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b22f96d293
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
daniel-graham-amplitude
approved these changes
Aug 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
clickevents as dead-click candidates so canceled touch scroll gestures are ignoredpointerdowninput for rage-click and error-click detectionRoot cause
The shared click observable listened to
pointerdown. On touch devices, beginning a scroll over an allowlisted element emitted apointerdowneven though the gesture never completed as a click. If the page did not navigate or mutate within the dead-click timeout, the SDK incorrectly reported a dead click.Event-source history and rationale
Dead-click and rage-click tracking were originally introduced in #1146 using one shared native
clickobservable. #1210 later changed that shared observable topointerdownto improve rage-click capture on mobile. Rapid mobile taps can be consumed by browser scrolling, panning, or zoom gestures before a completedclickis emitted, whereaspointerdownrecords each attempted press immediately. That makespointerdownthe appropriate signal for counting repeated rage interactions.Because the observable was shared, the rage-click fix also moved dead-click detection to
pointerdown, even though that was not the stated purpose of #1210. A dead click represents a completed activation that produced no response; a touch that begins a scroll is not a completed activation. This PR splits the streams so rage clicks keep the mobile behavior from #1210 while dead clicks return to their original nativeclickboundary.Error clicks continue to use
pointerdownfor a separate reason: the correlated browser error may occur in an early pointer handler before a nativeclickis emitted. Other frustration signals retain their existing event sources.Impact
Scroll flicks that begin over large interactive elements such as product-card links no longer produce dead-click false positives. Existing rage-click and error-click behavior remains unchanged.
Testing
pnpm --filter @amplitude/plugin-autocapture-browser buildpnpm --filter @amplitude/plugin-autocapture-browser exec jest --watchman=false --runInBand(24 suites, 418 tests)pnpm --filter @amplitude/plugin-autocapture-browser lintgit diff --checkLinear
SDK-200: Need to be fixed: Dead Click false positives from scroll-flick touches
Note
Medium Risk
Changes frustration autocapture event sourcing for dead vs rage/error clicks; behavior is well-tested but affects analytics signal semantics on touch devices.
Overview
Dead-click detection now listens for completed native
clickevents instead of sharing a singlepointerdownstream, so touch scroll-flicks that start on links (e.g. product cards) no longer time out as dead clicks when no navigation or mutation occurs.The frustration plugin wires two enriched observables:
clickfor dead clicks andpointerdownfor rage and error clicks, preserving prior mobile behavior for those signals.PointerDownObservableis added toObservablesEnumandAllWindowObservables.Regression tests cover scroll-gesture vs real dead click vs mutation cancellation and rage-from-
pointerdown; unit tests mock the split streams. A manual scroll-flick test page was added undertest-server/autocapture/.Reviewed by Cursor Bugbot for commit b22f96d. Configure here.