-
-
Notifications
You must be signed in to change notification settings - Fork 338
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
Getting : TypeError: undefined is not an object (evaluating 'stream.id') when removing a shared screen #268
Comments
I think it's better to find out why the error happens (rather than just checking conditions with no knowledge of why they could fail). BTW: have you identified the exact line in which such a |
Agreed with @ibc here. Adding a check is a stopgap at best. |
We've run into this issue as well, I can elaborate. The use-case is a long-lived peer connection where remote streams are frequently added/removed. On removal the stream is not found in The root cause appears to be #164 where a unique ID was added to the stream ids that are tracked internally. The generated ids are not properly communicated to the javascript layer, and so the cleanup logic fails when a remote stream is removed. We originally tried removing the unique IDs because we don't use Kurento, but this resulted in some media failures, so I later patched the javascript to look for a substring match. This works fine because we generate unique ids, but would fail for the Kurento case. I think that a more robust fix would be to make sure that the randomly generated ID is communicated to the javascript layer properly from Swift. I looked at doing this myself, but my Swift-fu is weak, and I couldn't figure out how to communicate the id properly in a short period of time. |
@justindujardin I don't understand. #164 was already fixed so long ago, and random stream ID generated in Swift land is properly exposed/propagated to JavaScript 1, 2. |
@ibc I setup a test to show the problem happening in the debugger. The issue, I now recall, is that when the removestream event is generated, it does not have the correct id. During the stream add, the id is setup properly: During removestream, the UUID is not present in the streamId: |
The bug is here: When the self.id = rtcMediaStream.label + "-" + UUID().uuidString Such a However, when the self.eventListener([
"type": "removestream",
"streamId": rtcMediaStream.label
]) Obviously, This bug is a regression produced by #164, which indeed solves a different issue, but creates this one.
Since the ObjC
Said that:
|
Did any of you guys manage to fix it? @magestican @ibc @saghul @justindujardin |
Hi, sorry can't do PR (as got only internal git repos behind firewall), but here is patch which fixes the issue for us:
Regards, |
Will make PR @l7s thx. |
Will also investigate this comment |
@l7s Thank you I made a PR and confirmed the fix, will be on 5.0.2 |
Whenever i remove a shared screen stream on chrome in windows, i get this exception on my ios app built with iosrtc :
callbackFromNative — cordova.js:314 TypeError: undefined is not an object (evaluating 'stream.id').
I have gone through the source code and there are 3 or 4 situations when source.id is being used by iosrtc, could a check be added anywhere stream.id is being used so this doesnt happen?
The text was updated successfully, but these errors were encountered: