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: Implement flood control with 1024 max events #359

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

rpapani
Copy link

@rpapani rpapani commented Jan 18, 2025

If the end users are clicking on an element repetitively, it typically indicates a problem like broken experience, confusing UI etc. #339 introduced to not to track the repeating clicks, because of which we won't be able to find some of the issues faced by users.

Currently, PSS considers if the user is clicking 10 times on the same selector with in the same session, we'll record as a rageclick (naming is little different in PSS) and based on such instances, we'll create an opportunity for our customers to fix. For PSS to continue to find these blind clicks and help our customers, we'd like to have the repeating clicks collected as valid RUM checkpoints.

This PR will introduce the flood control to limit the max events collection to 1024.

Related PRs - #339

@kptdobe
Copy link
Contributor

kptdobe commented Jan 20, 2025

#339 has been introduced because we saw quite a lot of "clicks go crazy" where several hundreds or even thousands were collected on some random elements. I agree that the fix provided back then is pretty limiting (only one click per element is tracked) and I agree with your potential fix.

I am not sure that you will be able to deduct a rageclick: because of these unreproducible and completely random "clicks go crazy" (my suspicion is browser bug or a bug in some 3rd party injected JS code), you will only be able to report "too many (frequent) clicks on this element" which will require investigations. At least, it will give you a start point to investigate.

Let's see what this gives us.

@rpapani rpapani changed the title fix: collect repeating clicks upto max configuration fix: Implement flood control with 1024 max events Jan 30, 2025
@@ -35,9 +35,12 @@ const blocksMO = window.MutationObserver ? new MutationObserver(blocksMCB)
const mediaMO = window.MutationObserver ? new MutationObserver(mediaMCB)
/* c8 ignore next */ : {};

let maxEvents = 1023;
Copy link
Author

@rpapani rpapani Jan 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@trieloff Since I'm decrementing this, using maxEvents instead of MAX_EVENTS. If using const is recommended, then I'll do something like

const MAX_EVENTS = 1023;
let maxEvents = MAX_EVENTS;

Please let me know if this way is preferred.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants