Skip to content
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

Webapp: user who turns off computer hangs forever online #66

Closed
sanmiguel2019 opened this issue Mar 17, 2021 · 11 comments
Closed

Webapp: user who turns off computer hangs forever online #66

sanmiguel2019 opened this issue Mar 17, 2021 · 11 comments
Labels

Comments

@sanmiguel2019
Copy link

sanmiguel2019 commented Mar 17, 2021

It's not actally a bug and not a feature request but a problem that should be fixed to avoid confusing situations between users.

Alice uses webapp in Windows 97 computer, Chrome browser.

Dave uses webapp in Android phone, Chrome browser.

Alice and Dave are chatting and then Alice turns off (hibernates) her computer without closing browser.

Dave sees that Alice is still online and send one more message. Alice does not answer.
After 1 hour Dave still sees that Alice is online. Send a message but Alice does not answer.
The same after 3 hours.

Then Bob closes the webapp in his phone and opens it again. Now he sees that Alice has been seen 3 hours ago.

So, the problem is the following: user who turns off (hibernates) computer will be visible as "online" until the recipient reloads the application.

Incorrect online status display was already described here. User should not be "online" if browser's tab with Tinode is not active (visible) because turned on computer does not mean that user is using using computer or Tinode's webapp.

The situation where an user is seen online even if his computer is turned off is even more strange.

@or-else
Copy link
Contributor

or-else commented Mar 19, 2021

Dave sees that Alice is still online and send one more message.

That is only possible if Alice's computer is still using internet connection while in hybernation, which is usually not the case.

So, the problem is the following: user who turns off (hibernates) computer will be visible as "online" until the recipient reloads the application.

That is certainly not the case.

The most likely reason is that (in terms of users you have described), Bob's webapp lost the notification from Alice.

@sanmiguel2019
Copy link
Author

The most likely reason is that (in terms of users you have described), Bob's webapp lost the notification from Alice.

Probably. Today Alice hybernated computer and immediately appeared as offline on Bob's phone. But Bob's phone's screen was on. I will try to test it again when phone's screen is off.

@or-else
Copy link
Contributor

or-else commented Mar 20, 2021

I'm certain the problem is in Bob's client. It's quite simple. When Bob reconnects, he gets the list of subscriptions and online for Alice is absent because it's the default 'false'. It is absent so it does not update the original online: true for Alice. And automatic reset online to offline of all contacts when Bob goes offline does not work because Bob's client is suspended instantly.

@sanmiguel2019
Copy link
Author

The problem, however, exists.

Scenario N 1

Alice hybernates her computer. Bob's phone screen is ON and he is active in the webapp. Alice's status changes to "offline" as soon as she hybernates computer.

Scenario N 2

Bob is active in the webapp. Then he turn's phone's screen off but leaves the webapp open. While Bob's phone screen is off, Alice hybernates computer. When Bob turns phone's screen on again, he sees that Alice is still online. Bob performs various activities - send messages in other topics, return to the contacts list but Alice's status doesn't change - she is still online.

Bob's phone loses Internet connection. While webapp reconnects, the status of Alice for a moment changes to "offline" but after reconnecting Alice is online again.

Comments

Correct online/offline status of users is a very important thing in every messenger. If it doesn't work properly, it doesn't make any sense at all. I don't know Reactjs and can not send pull requests or something but i't the thing that should be fixed in some way. I guess Tinode's webapp should perform some actions like online/offline status, reconnection timeout based on visibilityChange event. I have another post about this problem.

I have my computer on all day and web.whatsapp.com is open in some browser's tab. I see messages coming to me, but I know I won't show up online until the tab with whatsapp is active (visible). If it were otherwise, I would not have opened the whatsapp. If a person sees that you're online but you don't reply to messages, what can think?

In case of Tinode's webapp it does not actually show if user is online (is using the webapp) but whether the computer is turned on with Tinode's webapp openeted in some tab.

@or-else
Copy link
Contributor

or-else commented Mar 22, 2021

I agree there is a bug in Bob's reconnect: Bob's webapp does not clear Alice's online status on reconnect. I believe the analysis I gave in the previous message is correct. Would you like to help by sending a pull request? Otherwise it has to wait.

You also describe a feature to show user offline while the webapp is in an inactive tab. That is not an obviously good thing. The user is actually online getting your messages, just not reading them. Why should we send the fake offline status? I can see value in introducing an "away" status for that.
This feature request is unrelated to the bug. Please open a separate issue for it otherwise it may get lost.

@sanmiguel2019
Copy link
Author

The user is actually online getting your messages, just not reading them. Why should we send the fake offline status?

  1. In mobile phones user also is getting messages/notifications and probably not reading them, but it does not appear online 24 hours. Webapp and mobiles apps should be functioning in the same way. If not, users will not be able to understand what actually means online and offline. User A who sends a message to user B can not know if user B is using the web app or mobile app. He can´t know if user B appears online because is really active in Tinode or just because his computer ir turner on with Tinode opened in some tab.

  2. It will not be a fake offline status. I am sure that status online should should that user is currently active in Tinode's webapp/mobile apps, not that his device is turned on and connected to Internet. Look at whatsapp with 2 billion users - user is online only when is active in the app.

  3. It's also about privacy. Maybe I am in a bad mood and don't want to talk to anyone. Maybe I have turned on the webapp because I am waiting for a message from some particular user and I don't want other users to see me online because online status expects replies to the messages. I don't want other users to know how long my computer is turned on and they will know it because with Tinode in some tab I will always be online. Of curse, I can close the tab, but why I should close/open/close the webapp if there is a simple solution - not to show user online if he is not active in Tinode.

  4. A few months ago one of my friends had a problem. She lost her phone but had a tablet. She called me from an airport and asked urgently to send some files in Facebook because didn't have whatsapp anymore. I have not Messenger nor Facebook apps installed, so I sent files from Facekook's website seeing her online in the chat. I was in hurry and sent a message - please confirm that is that what you wanted. It took 5 minutes, but she didn't answer. 10 minutes - no answer but she is still online. I got angry and called her. She apologized for going to drink coffee, not expecting it to be so fast, and therefore not watching the tablet. I don't know, online/offline status in facebook works in the same way as in Tinode but this is a real example of why real online status is important. If a person appears online you expect answer to your message. If you don't get answer, the person does not want to respond or read the message.

  5. Sometimes in Whatsapp I need to send some message to a person early in the morning or late in the night. If I see the person online or just seen, I send my message but I would not do so seeing a person offline. Maybe is still/already sleeping...?

So, fake online status is displayed now. Turned on compuer does not mean that a person is using computer, and online status in Tinode's webapp is status of the device and not of the user.

I can see value in introducing an "away" status for that.

Yes, away would be better that online when user is not active in the app. But who needs to know if user does not respond to messages because is offline or away? I am more than sure that with Tinode I will get a huge amount of support requests of my users with the question "why I am online all the time?"

@or-else
Copy link
Contributor

or-else commented Mar 24, 2021

I must repeat: please open a separate issue for your feature request. This issue is about a bug. It will be closed when the bug is fixed. Your discussion of the feature will be lost. I will not comment on your feature request here.

@sanmiguel2019
Copy link
Author

Sorry, I just answered to your message about fake online status and away status.

@or-else
Copy link
Contributor

or-else commented Apr 4, 2021

Probably fixed in tinode/tinode-js@a96b82b

@or-else
Copy link
Contributor

or-else commented Apr 26, 2021

Have you had a chance to check if it's fixed? I'm going to make 0.17.0 release next week.

@sanmiguel2019
Copy link
Author

I tested it yesterday. Looks that the problem is fixed.

@or-else or-else closed this as completed Apr 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants