The title is not clear enough. let's explain it in detail. The message that A user needs to receive. One is to determine the status on the server based on the last operation, such as whether the chat window is opened, and then send different messages according to the status. for example, if the chat window is opened, the server sends the chat information, if it is not enabled, send it... the title is not clear enough. let's explain it in detail.
The message that A user needs to receive.
One is to determine the status on the server based on the last operation, such as whether the chat window is opened, and then send different messages according to the status. for example, if the chat window is opened, the server sends the chat information, if it is not enabled, a message is sent.
The other is that the server sends A message. after receiving the message, user A uses JS to determine whether the window is opened and then selects whether to display or prompt.
I think the first method is more controllable for information, and the server computer is better than the user end, which can ensure information integrity. However, if an error occurs in status retrieval, it will be messy.
The second method is easy to write, but the user experience is not very good. after all, we need to perform logic processing.
The server-side code is written on the basis of wokerman. it should be less relevant to this issue.
Or is there another better way? I hope that our predecessors will not be enlightened. Thank you.
Reply content:
The title is not clear enough. let's explain it in detail.
The message that A user needs to receive.
One is to determine the status on the server based on the last operation, such as whether the chat window is opened, and then send different messages according to the status. for example, if the chat window is opened, the server sends the chat information, if it is not enabled, a message is sent.
The other is that the server sends A message. after receiving the message, user A uses JS to determine whether the window is opened and then selects whether to display or prompt.
I think the first method is more controllable for information, and the server computer is better than the user end, which can ensure information integrity. However, if an error occurs in status retrieval, it will be messy.
The second method is easy to write, but the user experience is not very good. after all, we need to perform logic processing.
The server-side code is written on the basis of wokerman. it should be less relevant to this issue.
Or is there another better way? I hope that our predecessors will not be enlightened. Thank you.
The original message is sent to the front end for processing, which does not affect the user experience.