G
YouTube TikTok Games
Skip to content

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

Open

Description

@sanmiguel2019

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.

Activity

  1. or-else commented on May 16, 2020

    @or-else
    Contributor

    When user closes the browser

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

  2. sanmiguel2019 commented on May 18, 2020

    @sanmiguel2019
    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

  3. or-else commented on May 18, 2020

    @or-else
    Contributor

    You are welcome to send a pull request.

  4. 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[/+] on Aug 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions