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

Fix peerconnetcion connecting state #2435

Merged
merged 1 commit into from
Mar 3, 2023
Merged

Fix peerconnetcion connecting state #2435

merged 1 commit into from
Mar 3, 2023

Conversation

cnderrauber
Copy link
Member

The peerconnection state should transit to connecting if icestate is checking or dtls connecting

Description

Reference issue

Fixes #...

@codecov
Copy link

codecov bot commented Mar 3, 2023

Codecov Report

Patch coverage: 60.00% and project coverage change: -0.08 ⚠️

Comparison is base (1e5378a) 77.70% compared to head (b7c9b8c) 77.63%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2435      +/-   ##
==========================================
- Coverage   77.70%   77.63%   -0.08%     
==========================================
  Files          87       87              
  Lines        9298     9300       +2     
==========================================
- Hits         7225     7220       -5     
- Misses       1644     1649       +5     
- Partials      429      431       +2     
Flag Coverage Δ
go 79.41% <60.00%> (-0.08%) ⬇️
wasm 70.15% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
peerconnection.go 78.00% <60.00%> (-0.10%) ⬇️
internal/mux/mux.go 84.78% <0.00%> (-4.35%) ⬇️
sctptransport.go 77.15% <0.00%> (-0.75%) ⬇️
operations.go 92.59% <0.00%> (+1.85%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@Sean-Der
Copy link
Member

Sean-Der commented Mar 3, 2023

A unit test for updateConnectionState might be nice! Seems like it would be easy to do (might even have one already)

but approval from me! If you don't think a test is needed that is totally fine

@cnderrauber cnderrauber force-pushed the pc_connecting branch 2 times, most recently from 0002603 to c0a7f15 Compare March 3, 2023 07:13
@cnderrauber cnderrauber merged commit 220b1f3 into master Mar 3, 2023
@cnderrauber cnderrauber deleted the pc_connecting branch March 3, 2023 07:35
rainliu pushed a commit to webrtc-rs/webrtc that referenced this pull request Aug 2, 2024
* peer_connection: Implement state changes after spec

https://www.w3.org/TR/webrtc/#rtcpeerconnectionstate-enum

Ported from PION
pion/webrtc#2435

* peer_connection: Fix state transition race

DTLS transport state was previously acquired and sent over to the async
context returned. This would in some rare cases obviously lead to
updating peer connection state with an old DTLS transport state.
This would in turn lead to PeerConnection not updating it's state
correctly. Sometimes we would see PeerConnection never reaching Connected.

* peer_connection: Initialize PeerConnectionInternal correctly

PeerConnectionInternal was initialized with default transports and then
mutated right after. This resulted in create_ice_transport() using the
default DTLS transport instance which again led to state transition
reading DTLS transport state from the wrong instance.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants