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

Viewer fix #1953

Merged
merged 5 commits into from
Mar 20, 2024
Merged

Viewer fix #1953

merged 5 commits into from
Mar 20, 2024

Conversation

disa6302
Copy link
Contributor

@disa6302 disa6302 commented Mar 19, 2024

Issue #, if available:

What was changed?

  • Added new flags to monitor relay candidate gathering.

Why was it changed?

  • In case of viewer connection, the getIceServerConfig resolves after candidate gathering callback exits due to which relay candidates do not get added to the list, causing the gathering callback to assume that all candidates in the local candidate list are addressed and reported. This causes connections requiring TURN to fail. Adding new checks to ensure we stop gathering callback only if candidate pair is nominated or the relay candidates are added to the list fixes this problem. Forcing TURN does not catch this issue because the timer callback waits for the local candidate list to have some entry.

How was it changed?

  • Added a flag for 2 cases:
    1. addedRelayCandidate: This is set once relay candidate entries are created in addIceServerConfig.
    2. stopGathering: This is set once a pair is nominated. It is useful in cases where the connection with STUN/host candidates is already established and the SDK need not wait on relay candidates to be generated.

What testing was done for the changes?

  • Confirmed existing unit tests passed
  • Ran the JS SDK on phone and laptop with Viewer C SDK to confirm relay connection gets established and non-relay too
  • Ran the JS SDK on phone and laptop with Master C SDK to confirm existing functionality is not broken.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@codecov-commenter
Copy link

codecov-commenter commented Mar 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.20%. Comparing base (1eaede8) to head (bd06e78).

❗ Current head bd06e78 differs from pull request most recent head 4d3c8c5. Consider uploading reports for the commit 4d3c8c5 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1953      +/-   ##
==========================================
+ Coverage   76.09%   76.20%   +0.10%     
==========================================
  Files          48       48              
  Lines       13673    13676       +3     
==========================================
+ Hits        10405    10422      +17     
+ Misses       3268     3254      -14     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@disa6302 disa6302 marked this pull request as ready for review March 20, 2024 00:23
Copy link
Contributor

@niyatim23 niyatim23 left a comment

Choose a reason for hiding this comment

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

Lgtm! I tested C-SDK viewer, ICE_TRANSPORT_POLICY_ALL with JS-master, forced TURN and saw a seamless connection. I also tested this on Windows. Need to increase the timeout there because Windows is a bit slow: configuration.kvsRtcConfiguration.iceLocalCandidateGatheringTimeout = (20 * HUNDREDS_OF_NANOS_IN_A_SECOND);

Copy link
Contributor

@hassanctech hassanctech left a comment

Choose a reason for hiding this comment

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

lgtm

@disa6302 disa6302 merged commit f107343 into master Mar 20, 2024
25 checks passed
@disa6302 disa6302 deleted the 1.10.0-fix branch March 20, 2024 23:10
disa6302 added a commit that referenced this pull request Mar 27, 2024
* Viewer fix

* ICE agent update

* new flag

* stopgathering flag set

* Windows fix
disa6302 added a commit that referenced this pull request Mar 27, 2024
* Viewer fix

* ICE agent update

* new flag

* stopgathering flag set

* Windows fix
@stefankiesz stefankiesz restored the 1.10.0-fix branch August 2, 2024 19:17
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.

5 participants