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

[WIP] fix: Reconnect WebSocket #2054

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Commits on Mar 14, 2023

  1. fix: Reconnect WebSocket

    If an application is opened for a long time, aka in a
    long life browser's tab and you never close the browser
    and that the client can go on a sleep or else, WS can
    not be connected.
    
    So we try 2 things here:
    - First is to reconnect after a refreshedToken. It can
    be useful because CozyClient will try to refresh the token
    after 24h. So if the token is refreshed, it means that
    the client has an internet connexion and just make a request
    so it's the right time to reconnect with this new token
    
    - Second is to play with the visibility API. Before, the
    reconnexion was not very aggressive. We only tried if we
    were in a process to trying to reconnect by accelerating
    the reconnexion process. Now we try to reconnect also if
    the current websocket is closed.
    Crash-- committed Mar 14, 2023
    Configuration menu
    Copy the full SHA
    603e971 View commit details
    Browse the repository at this point in the history