Skip to content

fix: masking on textarea - #43

Merged
mydea merged 4 commits into
feat-mask-placeholder-title-attributesfrom
feat-fix-mask-all-text-false-and-mask-all-inputs-textarea
Feb 8, 2023
Merged

fix: masking on textarea #43
mydea merged 4 commits into
feat-mask-placeholder-title-attributesfrom
feat-fix-mask-all-text-false-and-mask-all-inputs-textarea

Conversation

@billyvg

@billyvgbillyvg commented Feb 7, 2023

Copy link
Copy Markdown
Member

If textarea has a child string content, it will get duplicated as a value attribute. Masking by text vs input can cause these two values to diverge (i.e. only one is masked). On playback, we remove duplicate textContent for textareas, which means we could show double textarea values: one masked, one unmasked.

If textarea has a child string content, it will get duplicated as a `value` attribute. Masking by text vs input can cause these two values to diverge (i.e. only one is masked). On playback, we remove duplicate textContent for textareas, which means we could show double textarea values: one masked, one unmasked.
@billyvg
billyvg changed the base branch from sentry-v1 to feat-mask-placeholder-title-attributesFebruary 7, 2023 03:07
@billyvgbillyvg changed the title feat fix mask all text false and mask all inputs textareafix: masking on textarea Feb 7, 2023
@billyvg
billyvg marked this pull request as ready for review February 7, 2023 03:09
@billyvg
billyvg requested review from Lms24 and mydeaFebruary 7, 2023 03:36
Comment threadpackages/rrweb-snapshot/src/utils.ts Outdated
value: string | null;
maskInputFn?: MaskInputFn;
}): string {
console.log('maskInputValue', tagName)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do we want this log or is it a debugging leftover?

assertSnapshot(snapshots);
});

it.only('should mask only inputs', async () => {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

is the only intentional?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Oops, what happens when I don't have precommit linters

@mydea

mydea commented Feb 8, 2023

Copy link
Copy Markdown
Member

Merging this fix so it can go out with todays release!

@mydea
mydea merged commit f7c1e66 into feat-mask-placeholder-title-attributesFeb 8, 2023
@mydea
mydea deleted the feat-fix-mask-all-text-false-and-mask-all-inputs-textarea branch February 8, 2023 09:31
@mydea

mydea commented Feb 8, 2023

Copy link
Copy Markdown
Member

damn, just noticed this doesn't go into develop, but into another feature branch 😅 hope I didn't mess anything up, sorry. I guess we can just fix this in the next release then 👍

@billyvg
billyvg restored the feat-fix-mask-all-text-false-and-mask-all-inputs-textarea branch February 8, 2023 18:34
@billyvg
billyvg deleted the feat-fix-mask-all-text-false-and-mask-all-inputs-textarea branch February 8, 2023 18:35
billyvg added a commit that referenced this pull request Feb 8, 2023
If textarea has a child string content, it will get duplicated as a
`value` attribute. Masking by text vs input can cause these two values
to diverge (i.e. only one is masked). On playback, we remove duplicate
textContent for textareas, which means we could show double textarea
values: one masked, one unmasked.
billyvg added a commit that referenced this pull request Feb 24, 2023
Fix bug introduced in #43 where
we masked both textarea's `value` and `textContent`, which meant the
text inside of the textarea would get duplicated. We can ignore
`textContent` in this case and set it to an empty string.
Sign up for freeto 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.

3 participants

@billyvg@mydea@Lms24