Skip to content

Conversation

@Lms24
Copy link
Member

@Lms24 Lms24 commented Apr 6, 2023

As reported in #7766, our transportOptions init field currently isn't typed correctly to accept BrowserOfflineTransportOptions, causing type errors when trying to configure the offline transport. This PR fixes this bug by making BrowserTransportOptions extend BrowserOfflineTransportOptions.

closes #7766

@timfish
Copy link
Collaborator

timfish commented Apr 6, 2023

I would need to test if it works but we might be be able to get the inference working for transportOptions from the supplied transport with this.

This is non-breaking since the generic has a default:

type BrowserOptions<TO extends BaseTransportOptions = BrowserTransportOptions> = Options<TO> & BrowserClientReplayOptions;
function init<TO = BrowserTransportOptions>(options: BrowserOptions<TO>) {

@timfish
Copy link
Collaborator

timfish commented Apr 6, 2023

we might be be able to get the inference working for transportOptions from the supplied transport with this

Oh no, it's seems much more complicated and not a simple fix...

@Lms24
Copy link
Member Author

Lms24 commented Apr 6, 2023

Yeah I tried your suggestion but got type errors all over the place 😅 I'd say we go with this unless there are other concerns (happy to try something different though)

Copy link
Collaborator

@timfish timfish left a comment

Choose a reason for hiding this comment

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

Yeah, I think this is good for now!

@Lms24 Lms24 merged commit 4395d74 into develop Apr 6, 2023
@Lms24 Lms24 deleted the lms/fix-types-offline-transport-options-browser branch April 6, 2023 09:18
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.

Sentry.init typings do not support BrowserOfflineTransportOptions for offline transport

4 participants