“User is typing...” typing indicator in topic and chat
kikii last edited by kikii
Hello everyone it may be added in the future a feature like "user is typing...'' in the last post and it would make writing posts more interesting and you'd know somebody was replying.
It would be a good solution to keep users from posting a topic because they will know that someone is responding.
Yes... we did want to introduce this, and we did a long long time ago, but removed it because it was not performant.
Especially on large topics with many thousands of users, if someone were to start replying, the network instantly became congested with "user is typing" notifications, and eventually crashed the server... oops.
We might look into reintroducing this again in the topic presence plugin.
Kindly consider the following:
- When the user starts typing, client sends "typing notif" to the server
- If the user continues to type after 30 sec, the clients sends another "typing notif"
- The server broadcast "user typing notif" to the clients upon receipt of said (1) and (2), iff there was no prior "user typing notif" in the past 30 sec. (just to make sure the client is not illegally pushing typing notif)
- The client clears out "user typing" from the DOM upon receipt of a message from said user, or following 30sec since the server sent "user typing notif"; and,
- As for server->client notif in (3):
a. (3) is executed for all clients that notified the server, such that a single message is formed containing all "typing" users; and,
b. (3) is concatenated to a chat message sent by a user to same room (if there was one); and,
c. (3) is executed just for the online users.
While not perfect, the cost is minimal:
client -> server: 1 message per typing users per 30 sec.
server -> online clients: 1 message containing all typing users per 30sec. (potentially no message at all given 5b).
Changing the latency granularity (i.e., 30sec above) will set a tradeoff between usability and cpu cycles.
I also think that doing it only for online users would reduce the server load a little.
@laserfire3 Yes, we only did it for online users. This slowdown only occured for forums with many thousands on line at the same time.
@julian Maybe you can do it only as a plugin or option to disable it in the administration panel or the user.Then if someone has problems with a server overload or with notifications it will disable it. This could be a compromise between supporters and opponents of this add-on.