Skip to content

Conversation

waltjones
Copy link
Contributor

Description of the change

Enables scrubbing of DOM inputs in telemetry.

Type of change

  • New feature (non-breaking change that adds functionality)

Checklists

Development

  • Lint rules pass locally
  • The code changed/added as part of this pull request has been covered with tests
  • All tests related to the changed code pass in development

Copy link
Contributor

@matux matux left a comment

Choose a reason for hiding this comment

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

This looks great! I think I found something in the scrubInputValue logic where I'm not sure what it does is what we want, so left two comments.

this.maskInputOptions[inputType]
) {
if (this.maskInputFn) {
value = this.maskInputFn(value, element);
Copy link
Contributor

Choose a reason for hiding this comment

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

If value happens to be masked in the conditionals in line 802:813, you'd be passing the masked value to this.maskInputFn here.

Maybe store the value in some originalValue var and pass that here?

Comment on lines 827 to 835
if (
domUtil.isMatchingElement(element, this.scrubClasses, this.scrubSelectors)
) {
value = mask;
}

if (inputType === 'password') {
value = mask;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Could this override the return value of the custom this.maskInputFn? Is that expected behavior?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, this is expected. If it's a password field, it is always masked. Making it an early return at the top would make that more obvious.

Comment on lines 79 to 80
((options = { scrubFields, autoInstrument: { log: false } }),
(rollbar = new Rollbar({})));
Copy link
Contributor

@matux matux Oct 15, 2025

Choose a reason for hiding this comment

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

non-blocking, don't feel strongly, just asking

Is there any reason this is like this and not just

  options = { scrubFields, autoInstrument: { log: false } };
  rollbar = new Rollbar({});

?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think prettier did this? Let me see what happens when I undo it.

<title>Elements for testing DOM event handling</title>
</head>
<body>
<div class="container" id"main-container">
Copy link
Contributor

Choose a reason for hiding this comment

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

Yikes, there's an = missing between id and "main-container" here!

@waltjones waltjones merged commit f3145ff into master Oct 15, 2025
6 checks passed
@waltjones waltjones deleted the waltjones/scrub-dom-inputs branch October 15, 2025 18:11
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