Add/delete endpoints to/from already interconnected members
Opened this issue · 1 comments
Summary
When we trying to create interconnected Endpoint
s for Member
s which already interconnected, panic will be throwed with PeerError::WrongState
error.
Also if we delete some Endpoint
from interconnected Member
s they Peer
s will be removed even if some interconnected Endpoint
s still exists. This is related bug because we can fix it with Event::TracksRemoved
. Steps to reproduce for this bug will be in discussion to this issue.
Steps to reproduce
- Create room with this spec:
kind: Room
id: pub-sub-video-call
spec:
pipeline:
caller:
kind: Member
credentials: test
spec:
pipeline:
publish:
kind: WebRtcPublishEndpoint
spec:
p2p: Always
responder:
kind: Member
credentials: test
spec:
pipeline:
play:
kind: WebRtcPlayEndpoint
spec:
src: "local://pub-sub-video-call/caller/publish"
- Start call for
responder
andcaller
- Add
WebRtcPublishEndpoint
toresponder
:
id: publish
kind: WebRtcPublishEndpoint
spec:
p2p: Always
- Add
WebRtcPlayEndpoint
tocaller
:
id: play
kind: WebRtcPlayEndpoint
spec:
src: "local://pub-sub-video-call/responder/publish"
What is the current bug behavior?
Panic with PeerError::WrongState
error should be thrown.
What is the expected correct behavior?
New MediaTrack
should be applied to the caller
and responder
.
Relevant logs and/or screenshots
This panic you may find in medea::signalling::room::Room::connect_endpoints
.
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: PeerError(WrongState(PeerId(1), "New", "Stable"))', src/libcore/result.rs:1084:5
Possible fixes
Implementation of Event::TracksApplied
and Event::TracksRemoved
should fix this bug.
Steps to reproduce for deleting Endpoint
from already interconnected Member
s
- Create
Room
with this spec:
kind: Room
id: pub-pub-video-call
spec:
pipeline:
caller:
kind: Member
credentials: test
spec:
pipeline:
publish:
kind: WebRtcPublishEndpoint
spec:
p2p: Always
play-responder:
kind: WebRtcPlayEndpoint
spec:
src: "local://pub-pub-video-call/responder/publish"
responder:
kind: Member
credentials: test
spec:
pipeline:
publish:
kind: WebRtcPublishEndpoint
spec:
p2p: Always
play-caller:
kind: WebRtcPlayEndpoint
spec:
src: "local://pub-pub-video-call/caller/publish"
- Connect
caller
andresponder
- Delete
local://pub-pub-video-call/caller/play-responder
endpoint
What is the current bug behavior?
Peer
s between caller
and responder
will be deleted.
What is the expected correct behavior?
Only some MediaTrack
s should be deleted from Peer
s with Event::TracksRemoved
.