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

Add PeerConnection state machine #20

Merged
merged 3 commits into from
Nov 27, 2023
Merged

Add PeerConnection state machine #20

merged 3 commits into from
Nov 27, 2023

Conversation

mickel8
Copy link
Member

@mickel8 mickel8 commented Nov 24, 2023

No description provided.

Copy link

codecov bot commented Nov 24, 2023

Codecov Report

Merging #20 (0cbf5a1) into master (daa448a) will increase coverage by 2.46%.
The diff coverage is 94.11%.

❗ Current head 0cbf5a1 differs from pull request most recent head a86f6ab. Consider uploading reports for the commit a86f6ab to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #20      +/-   ##
==========================================
+ Coverage   82.32%   84.78%   +2.46%     
==========================================
  Files          10       10              
  Lines         430      447      +17     
==========================================
+ Hits          354      379      +25     
+ Misses         76       68       -8     
Files Coverage Δ
lib/ex_webrtc/dtls_transport.ex 87.01% <95.00%> (+5.06%) ⬆️
lib/ex_webrtc/peer_connection.ex 80.66% <92.85%> (+4.33%) ⬆️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update daa448a...a86f6ab. Read the comment docs.

@mickel8 mickel8 force-pushed the conn-state branch 3 times, most recently from 743607b to 125eb5d Compare November 24, 2023 18:27
@mickel8 mickel8 marked this pull request as ready for review November 24, 2023 18:33
@mickel8 mickel8 requested a review from LVala November 24, 2023 18:33
Comment on lines 553 to 557
defp next_conn_state(ice_state, dtls_state) when ice_state == :failed or dtls_state == :failed,
do: :failed

defp next_conn_state(ice_state, dtls_state) when ice_state == :new and dtls_state == :new,
do: :new
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
defp next_conn_state(ice_state, dtls_state) when ice_state == :failed or dtls_state == :failed,
do: :failed
defp next_conn_state(ice_state, dtls_state) when ice_state == :new and dtls_state == :new,
do: :new
defp next_conn_state(:failed, :failed), do: :failed
defp next_conn_state(:new, :new), do: :new

Copy link
Member Author

Choose a reason for hiding this comment

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

Can't do this with the first one becasue of or.
I can do

defp next_conn_state(:failed, _), do: :failed
defp next_conn_state(_, :failed), do: :failed

Copy link
Member

Choose a reason for hiding this comment

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

Ah, right! Although, I think I still prefer the version with pattern matching.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed

Comment on lines 563 to 565
defp next_conn_state(ice_state, dtls_state)
when ice_state in [:connected, :completed] and dtls_state in [:connected],
do: :connected
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
defp next_conn_state(ice_state, dtls_state)
when ice_state in [:connected, :completed] and dtls_state in [:connected],
do: :connected
defp next_conn_state(ice_state, :connected)
when ice_state in [:connected, :completed], do: :connected

@elixir-webrtc elixir-webrtc deleted a comment from mickel8 Nov 27, 2023
@mickel8 mickel8 merged commit 79192f2 into master Nov 27, 2023
1 of 2 checks passed
@mickel8 mickel8 deleted the conn-state branch November 27, 2023 09:57
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.

2 participants