miroslavpejic85 / mirotalk

🚀 WebRTC - P2P - Simple, Secure, Fast Real-Time Video Conferences Up to 8k and 60fps, compatible with all browsers and platforms.
https://p2p.mirotalk.com
GNU Affero General Public License v3.0
3.03k stars 558 forks source link

No Host in meeting! #156

Closed professionalNoob123 closed 1 year ago

professionalNoob123 commented 1 year ago

Hey @miroslavpejic85 !

Describe the bug

The bug is --> when there are more than 2 peers and then the host leaves, there is no host in the meeting. Thus, no one is able to lock/unlock the room (and other things only host can do).

To Reproduce

Steps to reproduce the behavior:

  1. Create a new meeting (ex. Room: 1234)
  2. Make 2+ peers join (ex. Room: 1234, connected peers: 4 [including host])
  3. Make the host disconnect (person who created the meeting [step 1])
  4. No one is the host, no one can lock/unlock room and other host only functions (like eject all)

Expected behavior

Expected someone else to become the host when the first person leaves.

Desktop - Mobile

Please complete the following information:

miroslavpejic85 commented 1 year ago

Hello @professionalNoob123,

Expected someone else to become the host when the first person leaves.

The last one that remain in the meeting, become the host.

PS: I don't think giving the roles of host to a random one is the best thing, also because when I leave the room I don't have to worry about it who should I give permission to eject the others and so on. I don't see it as a bug, and I'd rather keep this current logic, what do you think?

Join also with us on forum, where we can also discuss about, channel: ideas-and-suggestions. Thank you!

professionalNoob123 commented 1 year ago

PS: I don't think giving the roles of host to a random one is the best thing, also because when I leave the room I don't have to worry about it who should I give permission to eject the others and so on. I don't see it as a bug, and I'd rather keep this current logic, what do you think?

Yes, you shouldn't give the role of host to a random one. Though, let's say I'm in a meeting (as host) and connected to 3 other peers, and the room is unlocked (default). Then I disconnect due to internet issues... thus there is no host and the room is unlocked. Which could lead to someone else joins the meeting (ex. peer name: Joe) which may be a security issue because nobody can control him (Joe).

PS: I'm not saying to lock the meeting as default

miroslavpejic85 commented 1 year ago

Yes, you shouldn't give the role of host to a random one. Though, let's say I'm in a meeting (as host) and connected to 3 other peers, and the room is unlocked (default). Then I disconnect due to internet issues... thus there is no host and the room is unlocked. Which could lead to someone else joins the meeting (ex. peer name: Joe) which may be a security issue because nobody can control him (Joe).

A ok, got it, I will think about how to solve this behavior. Thank you!

miroslavpejic85 commented 1 year ago

Hello @professionalNoob123,

It should be fixed now.

Test:

  1. Join room with 4 different peers, username (User-1, User-2, User-3, User-4)
  2. The User-1 is the presenter
  3. Exit room or disconnect due to internet issues the User-1
  4. Join again with User-1 and you can see its again presenter.

Note The presenter (host) is identified by:

professionalNoob123 commented 1 year ago

Great! Everything works good.

Thank You

miroslavpejic85 commented 1 year ago

Note As Public IPv4 can changes randomly if someone use a VPN, the presenter is now matched by: