Skip to content

Conversation

@backportbot-nextcloud
Copy link

backport of #3882

As there could be two data channels with the same name (created by the
remote and local side) and they will be connected at different time, it
is possible to get an onopen event while the other connection is still
in connecting state.

When the above situation happens, pendingMessages cannot be resent
because the check is on the remote-to-local connection, which is still
in "connecting" state, while the onopen is called for local-to-remote.

At this moment the sendDirectly function will queue the message again
and the loop will try to re-transmit the message again on the next
iteration where it will be queue again, and so on.

To prevent this infinite loop, a copy of the pendingMessages queue is
created and resend happens on this "new" list. This way in case the
channel is already opened the transmission will happen, and in case
the channel is not yet opened it will be re-queued for the next onopen
when the other connection is established.

Signed-off-by: Vladislav Hristov <[email protected]>
@backportbot-nextcloud backportbot-nextcloud bot added bug feature: WebRTC 🚡 WebRTC connection between browsers and/or mobile clients labels Aug 27, 2020
@backportbot-nextcloud backportbot-nextcloud bot added this to the 💙 Next Minor (19) milestone Aug 27, 2020
Copy link
Member

@danxuliu danxuliu left a comment

Choose a reason for hiding this comment

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

Tested and works 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug feature: WebRTC 🚡 WebRTC connection between browsers and/or mobile clients

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants