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 current user not included in user list returned by signaling #1522

Conversation

danxuliu
Copy link
Member

@danxuliu danxuliu commented Feb 8, 2019

When a user requests the signaling messages from the internal signaling server first the last ping of the user is updated. Then, after waiting for at most 30 seconds, the list of users active in the room is returned.

That list was based on the users whose last ping was more recent than 30 seconds ago, so when there were no other messages and the waiting timed out the last ping of the current user set when the request started happened 30 seconds ago or more, and thus the current user was not included in the returned list... unles her ping was updated to a more recent value by a different request.

Requesting the chat messages also updates the last ping of a user, which usually masked this issue. However, when both the signaling and the chat controller updated the last ping at the same second and the wait in the signaling timed out the current user was not returned in the list. In the web UI, when the current user is not in the user list returned by the signaling the user is disconnected from the others.

Due to all this sometimes, when the internal signaling server was used, a user was disconnected from a call for no apparent reason (although in real case scenarios it was eventually reconnected, which does not happen in the forced test scenario below).

Now the users returned in the list are those whose last ping is more recent than or equal to 30 seconds, or more recent than or equal to the signaling ping of the current user if it is larger than 30 seconds.

How to test:

  • Prevent the chat from updating the ping (just comment the call to ping() in ChatController), so the returned list depends only on the signaling ping and the bug can be reproduced consistently
  • Join a call with user A
  • Join the same call with user B
  • Wait

Result with this pull request:
The call goes on without interruptions.

Result without this pull request:
After 30 seconds the users are disconnected; further waiting does not cause a reconnection, it is needed that one of the participants leaves the call and joins again (in which case the problem will happen again after 30 seconds).

When a user requests the signaling messages from the internal signaling
server first the last ping of the user is updated. Then, after waiting
for at most 30 seconds, the list of users active in the room is
returned.

That list was based on the users whose last ping was more recent than 30
seconds ago, so when there were no other messages and the waiting timed
out the last ping of the current user set when the request started
happened 30 seconds ago or more, and thus the current user was not
included in the returned list (unless her ping was updated to a more
recent value by a different request, like polling for chat messages).

Now the users returned in the list are those whose last ping is more
recent than or equal to 30 seconds, or more recent than or equal to the
signaling ping of the current user if it is larger than 30 seconds.

Signed-off-by: Daniel Calviño Sánchez <[email protected]>
Copy link
Member

@Ivansss Ivansss 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 👍

@Ivansss
Copy link
Member

Ivansss commented Feb 8, 2019

/backport to stable15

@Ivansss Ivansss merged commit 43b1a2f into master Feb 8, 2019
@Ivansss Ivansss deleted the fix-current-user-not-included-in-user-list-returned-by-signaling branch February 8, 2019 09:16
@backportbot-nextcloud
Copy link

backport to stable15 in #1523

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review bug feature: signaling 📶 Internal and external signaling backends
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants