DecryptLogin icon indicating copy to clipboard operation
DecryptLogin copied to clipboard

Way to sync up to host

Open kyle8998 opened this issue 7 years ago • 2 comments

There is no way for viewers to sync to the host if they get disconnected

kyle8998 avatar Aug 07 '18 02:08 kyle8998

Suggestion: send an initial "sync" packet on connect.

Also suggest having # urls (such as domain.herokuapp.com/#/r/1) so that a viewer that has to reconnect can refresh the page and still stay in the same room

Joshfindit avatar Aug 28 '19 16:08 Joshfindit

Having more experience with the app now, I realize that I misinterpreted the issue.

Instead I suggest a "heartbeat". Not exactly sure what the method is that fails when a client is disconnected from the sync, but the symptoms are clear:

  • User and host both continue watching the video, but now there's no communication between the two. Play/pause has no effect on the disconnected one, and there's no position syncing.
  • The username may silently drop from the list of users in the room (needs more observation, but I suspect there's a delay here)
  • A refresh from the disconnected user is needed to regain the connection

Heartbeats are excellent in these cases:

  • If it's at X seconds, the host knows when a user has dropped to within at least X*2 (one lost is an anomaly, two is the beginning of a pattern)
  • If there is a confirmation returned, the client knows when their connection has been lost. This can resent a warning in the UI, as well as cause the client to start a reconnect attempt

In addition, the heartbeat can be used to relay timestamp sync data

And, to mitigate any problems:

  • If each heartbeat has a unique ID, accidental duplicates are not possible

Joshfindit avatar Mar 10 '20 16:03 Joshfindit