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

Change status from [online] to [away] or [offline] when the user is inactive or the tab is in the background #48

Open
sanmiguel2019 opened this issue May 16, 2020 · 3 comments

Comments

@sanmiguel2019
Copy link

When user closes the browser or switches to another browser tab, the status does not change to "offline" and is still visible as "online" for some 10 minutes. "Online" status only should be shown when browser tab with Tinode is opened and device's screen is not off.

@or-else
Copy link
Contributor

or-else commented May 16, 2020

When user closes the browser

You mean minimizes the browser?
When browser is closed the user goes offline in 5 seconds.

@sanmiguel2019
Copy link
Author

User: alice
using desktop computer, Chrome browser

is chatting with

User: dave
using mobile telephone, Firefow browser.

User "dave" closes the browser and turns telehone's screen off. More or less 3 minutes "dave" is still online.
Dave turns telephone's screen on and immediately appears online even without accessing the browser.

User "alise" is always online. "Alise" has opened multiple tabs in the browser. Even when not using "Tinode's" tab for a long time, she is always online.
User "alise" minimizes the browser and starts using another program. She is always online. Only when she closes completely "Tinode's" tab, the status after 5 seconds changes to "offline".

Look at web.whatsapp.com. Whatsapp's web version is opened all the day in my computer but it does not mean that I am always "online". I appear "online" only when the tab with Whatsapp is visible on my screen. As soon as I switch between browser tabs or start using another program (without closing the browser), I am "offline".

I think there should be used some page visibility api to detect correctly when user is using Tinode and when is not. For example:

https://github.com/pgilad/react-page-visibility

@or-else
Copy link
Contributor

or-else commented May 18, 2020

You are welcome to send a pull request.

@or-else or-else changed the title User online/offline status does not update correctly Change status from [online] to [away] or [offline] when the user is inactive or the tab is in the background Aug 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants