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

Cannot read property 'sdp' of undefined in Brave #701

Open
achingbrain opened this issue Jul 9, 2020 · 4 comments
Open

Cannot read property 'sdp' of undefined in Brave #701

achingbrain opened this issue Jul 9, 2020 · 4 comments

Comments

@achingbrain
Copy link
Contributor

achingbrain commented Jul 9, 2020

This appears to be related to Brave blocking browser fingerprinting, but the promise returned from RTCPeerConnection.createOffer can resolve to undefined (and not throw) resulting in the following error:

AggregateError: Failed to connect to peer: 
    TypeError: connection error 127.0.0.1:13579: Cannot read property 'sdp' of undefined

If you disable Shields in Brave it works as expected.

I'm not sure what simple-peer can do about that, other than guard on offer being undefined, treat it as a failure case and throw an appropriate error.

Similar issue: webrtcHacks/adapter#1028

@nazar-pc
Copy link
Collaborator

nazar-pc commented Jul 9, 2020

Well, if browser breaks standard APIs, I don't think library should do anything about it.
Check what it breaks and make detection outside of simple-peer in your app. You'll want to show a nice message to the user anyway instead of breaking app in unexpected way.

@achingbrain
Copy link
Contributor Author

Well, if browser breaks standard APIs, I don't think library should do anything about it

You're correct that it's weird and nonstandard, and perhaps they shouldn't be doing it but part of the reason you use a library is to paper over the cracks in differences between implementations. I note there are already workarounds for other bad browser behaviour.

Check what it breaks and make detection outside of simple-peer in your app

The error occurs during the process of negotiating a connection. In order to make that detection you'd have to start negotiating a connection outside of simple-peer which means you're deep in WebRTC plumbing which sort of negates the point of using simple-peer in the first place.

@fippo
Copy link

fippo commented Jul 13, 2020

Has anyone filed an issue with brave? I understand the intention to limit the ip gathering but this solution is quite... harmful

@t-mullen
Copy link
Collaborator

t-mullen commented Aug 9, 2020

It seems to only happen when on an IP domain (e.g. 127.0.0.1). I've opened an issue with Brave.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants