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

Is this a bug? Sometimes an initiator with connection.userid = roomid gets a new UserID when opening a room #5

Open
ghost opened this issue Nov 18, 2018 · 2 comments

Comments

@ghost
Copy link

ghost commented Nov 18, 2018

There are strange moments in the work of the code.
In my case, the initiator has the parameters:

connection.autoCloseEntireSession = true
connection.userid = roomid

The script is very simple. Initiator refreshes the page. The server closes the room. The admin panel shows that the room is missing.

BUT! If the initiator tries to return and reopen the room, then RTCMultiConnection reports to the console that a user with that name already exists and gives him a new UserID. At the same time, the admin panel shows that there are no rooms at all.

In my case, only restarting the server node server.js or changing the name of the room helps.

What could it be?
Is this a bug or incorrect server installation?

@muaz-khan
Copy link
Owner

Seems like a bug. However I need to test and reproduce it. Hopefully next updates will fix it. Regards

@ghost
Copy link
Author

ghost commented Nov 18, 2018

I get a bug in the following way:

  1. Turn on the server
  2. Log in to the admin panel
  3. Initiator creates a room
  4. Broadcaster connects
  5. The admin panel shows that there are two users and one room.
  6. Turn off the server. Turn on the server.
  7. Admin panel reports Signaling-Server (users: 2, rooms: 0)
  8. After Disconnect Initiator triggers startCheckingForOwnerOpenRoom ()
function startCheckingForOwnerOpenRoom() {
	connection.checkPresence(roomid, function(isOwnerOnline) {
		if (isOwnerOnline === false) {
			connection.close();
			connection.closeSocket();
			connection.userid = roomid;
			
			connection.open(roomid, function(isRoomOpen, error) {	
				if (isRoomOpen === false) {
					console.log('connection.open: isRoomOpen false');
					connection.close();
					connection.closeSocket();
					setTimeout(function() {
						startCheckingForOwnerOpenRoom();
					}, 1000);
				} else {
					console.log('connection.open: isRoomOpen true');
				}
			});
			
			afterConnectingSocket();
			//return;
		}
		setTimeout(startCheckingForOwnerOpenRoom, 2000);
	});
}
  1. In the browser console at the Initiator, the RTCMultiConnection reports that a user with the same name exists and a new UserID is assigned to the Initiator.

As a result, connection.userid != roomid and the Initiator cannot open the room.

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

No branches or pull requests

1 participant