Skip to content

fix(replays): Show the correct Replay config option name maskFn #8169

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

Merged
merged 3 commits into from
May 23, 2023

Conversation

ryan953
Copy link
Member

@ryan953 ryan953 commented May 19, 2023

Typescript says that the function is called maskFn, but the tests are passing in maskTextFn to something...

Something is inconsistent, and either way the type, Pick<RecordingOptions, 'maskTextFn'>, is wrong!!! RecordingOptions doesn't have either maskFn or maskTextFn, it's coming from here: https://github.com/getsentry/sentry-javascript/blob/ryan953/replay-maskFn-docs/packages/replay/src/types/rrweb.ts#L32-L41

https://github.com/getsentry/sentry-javascript/blob/master/packages/replay/src/types.ts#L314-L317

See also: getsentry/sentry-docs#6988

@ryan953 ryan953 requested review from billyvg, Lms24 and mydea and removed request for billyvg May 19, 2023 21:21
Copy link
Member

@billyvg billyvg left a comment

Choose a reason for hiding this comment

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

Oops, good catch!

@@ -330,7 +330,7 @@ export interface ReplayIntegrationPrivacyOptions {
/**
* A callback function to customize how your text is masked.
*/
maskFn?: Pick<RecordingOptions, 'maskTextFn'>;
Copy link
Member

Choose a reason for hiding this comment

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

So this is correct because it comes from rrweb

Copy link
Member

Choose a reason for hiding this comment

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

Ah nevermind, I misread, you're right!

@@ -330,7 +330,7 @@ export interface ReplayIntegrationPrivacyOptions {
/**
* A callback function to customize how your text is masked.
*/
maskFn?: Pick<RecordingOptions, 'maskTextFn'>;
Copy link
Member

Choose a reason for hiding this comment

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

Ah nevermind, I misread, you're right!

@ryan953
Copy link
Member Author

ryan953 commented May 19, 2023

@billyvg it might make sense to go through more deeply and align the names internally in the codebase too. I'm not the authority on what we should be publishing here, but we're passing maskTextFn into tests.

@billyvg
Copy link
Member

billyvg commented May 19, 2023

maskFn should be the public interface to both rrweb's maskTextFn and maskInputFn

@github-actions
Copy link
Contributor

github-actions bot commented May 19, 2023

size-limit report 📦

Path Size
@sentry/browser - ES5 CDN Bundle (gzipped + minified) 21.03 KB (+0.05% 🔺)
@sentry/browser - ES5 CDN Bundle (minified) 65.68 KB (+0.09% 🔺)
@sentry/browser - ES6 CDN Bundle (gzipped + minified) 19.59 KB (+0.11% 🔺)
@sentry/browser - ES6 CDN Bundle (minified) 58.15 KB (+0.12% 🔺)
@sentry/browser - Webpack (gzipped + minified) 21.2 KB (+0.16% 🔺)
@sentry/browser - Webpack (minified) 69.07 KB (+0.05% 🔺)
@sentry/react - Webpack (gzipped + minified) 21.22 KB (+0.16% 🔺)
@sentry/nextjs Client - Webpack (gzipped + minified) 49.16 KB (+0.09% 🔺)
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) 28.67 KB (+0.09% 🔺)
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified) 26.9 KB (+0.1% 🔺)
@sentry/replay ES6 CDN Bundle (gzipped + minified) 48.24 KB (+1.32% 🔺)
@sentry/replay - Webpack (gzipped + minified) 42.1 KB (+1.53% 🔺)
@sentry/browser + @sentry/tracing + @sentry/replay - ES6 CDN Bundle (gzipped + minified) 67.21 KB (+1.07% 🔺)
@sentry/browser + @sentry/replay - ES6 CDN Bundle (gzipped + minified) 60.11 KB (+1.23% 🔺)

@ryan953
Copy link
Member Author

ryan953 commented May 19, 2023

maskFn should be the public interface to both rrweb's maskTextFn and maskInputFn

ok! maskFn in all the places!

@ryan953 ryan953 enabled auto-merge May 19, 2023 21:34
@ryan953 ryan953 merged commit 92847c6 into develop May 23, 2023
@ryan953 ryan953 deleted the ryan953/replay-maskFn-docs branch May 23, 2023 07:27
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.

3 participants