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

Unable to override only a few options for replayIntegration #10305

Closed
3 tasks done
joshkel opened this issue Jan 23, 2024 · 4 comments · Fixed by #10325
Closed
3 tasks done

Unable to override only a few options for replayIntegration #10305

joshkel opened this issue Jan 23, 2024 · 4 comments · Fixed by #10325
Labels
Package: react Issues related to the Sentry React SDK Type: Bug

Comments

@joshkel
Copy link
Contributor

joshkel commented Jan 23, 2024

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/react

SDK Version

7.95.0

Framework Version

React 18.2.0

Link to Sentry event

No response

SDK Setup

initSentry({
  dsn,
  integrations: [
      replayIntegration({
        maskAllText: true,
        blockAllMedia: true,
      }),
  ],
});

Steps to Reproduce

Pass a few options to replayIntegration in a TypeScript file.

Expected Result

Successful compilation - the changelog and migration docs make me think that this should work the same as new Replay({ maskAllText: true, blockAllMedia: true }).

Actual Result

Compilation errors - replayIntegration is declared as needing a nearly complete ReplayPluginOptions object, so it complains if any options are missing.

@github-actions github-actions bot added the Package: react Issues related to the Sentry React SDK label Jan 23, 2024
@jiadesen
Copy link

me too

@Shubhdeep12
Copy link
Contributor

Hi @mydea it looks like the issue is here for replay integration -

export const replayIntegration = ((options?: InitialReplayPluginOptions) => {

Reason - InitialReplayPluginOptions creates every option required except sessionSampleRate and errorSampleRate
Suggested fix - the type for options should be ReplayConfiguration imported above and used in the constructor for the replay class.

let me know if it is correct. I'll create a PR then.
Thanks

@AbhiPrasad
Copy link
Member

@Shubhdeep12 feel free to throw up a PR, I think that is correct

@Shubhdeep12
Copy link
Contributor

ok great, added a PR @AbhiPrasad

mydea pushed a commit that referenced this issue Jan 24, 2024
Before submitting a pull request, please take a look at our

[Contributing](https://github.com/getsentry/sentry-javascript/blob/master/CONTRIBUTING.md)
guidelines and verify:

- [ ] If you've added code that should be tested, please add tests.
- [ ] Ensure your code lints and the test suite passes (`yarn lint`) &
(`yarn test`).
fixes: #10305
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: react Issues related to the Sentry React SDK Type: Bug
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants