-
Notifications
You must be signed in to change notification settings - Fork 1
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
Users should be able to move others around #10
Comments
What is this groupmod? How does it work? My first thought would be create a
|
I think On the other hand, it seems sketchy to let users save the entire
Maybe this is better: save( fetch( |
For issue 1: The For issue 2: Statebus will automatically handle this once we implement the versioning diffsync. But for now, let's look at the clobbered changes in two cases:
Case 2 isn't too bad. People don't move groups very often, so the clobbers will be infrequent, and easy to recover from (just drag again). Case 1 can be recovered from by checking that each user in bus(->
cons = fetch('/connections').all
groups = fetch('/groups')
for c in cons
# check that it exists in a group exactly once
found = false
for g in groups
for i in g
if i == c
if found
# then delete element i from the group g using e.g. array.slice
found = true
# Make sure this client is live in /connections.all
if cons.indexOf(i) == -1
# then delete element i from the group g using e.g. array.slice
if not found
groups[0].push(c)
) Actually, we could put this function on the server, which would ensure for all clients that the data remains consistent. But my personal inclination would probably be to just ignore this bug, and use it as motivation for us to finish the versioned diffsync... :P |
Currently you can only move yourself in tawk. I can think of a couple reasons to move others:
A new user is confused and they're in their own group where nobody can hear them. An experienced user can help them out by moving them to a group.
Create a side conversation with somebody (one of the original use cases of tawk)
Users shouldn't be able to modify others'
/connection
objects directly, so we can create a new piece of state:/groupmod
.sb["/groupmod/user_id"] = new_group_id
The server will update the user's connection object, and broadcast the change to everybody.
The text was updated successfully, but these errors were encountered: