Skip to content

fix(replay): fixed type for options of replayIntegration #10325

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 1 commit into from
Jan 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/replay/src/integration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ let _initialized = false;
type InitialReplayPluginOptions = Omit<ReplayPluginOptions, 'sessionSampleRate' | 'errorSampleRate'> &
Partial<Pick<ReplayPluginOptions, 'sessionSampleRate' | 'errorSampleRate'>>;

export const replayIntegration = ((options?: InitialReplayPluginOptions) => {
export const replayIntegration = ((options?: ReplayConfiguration) => {
Copy link
Member

Choose a reason for hiding this comment

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

We'll want the options type to be

Omit<ReplayPluginOptions, 'sessionSampleRate' | 'errorSampleRate'>

because these sample rate options are deprecated and slated to be removed, can you confirm @mydea?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok then, In that case i guess it should be wrapped with Partial then.
Because the options are required in ReplayPluginOptions type. Causing the error mentioned.

Copy link
Member

Choose a reason for hiding this comment

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

@Shubhdeep12 Ah my mistake, it should be Omit<ReplayConfiguration, 'sessionSampleRate' | 'errorSampleRate'>

Copy link
Member

Choose a reason for hiding this comment

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

So I think ReplayConfiguration is correct for now, we can remove the deprecated fields in a follow up in v8!

// eslint-disable-next-line deprecation/deprecation
return new Replay(options);
}) satisfies IntegrationFn;
Expand Down