Skip to content

Web socket re-connection error on auto email monitoring turned on #20

Description

@bedead

Detailed problem:
We auto email monitoring option was enabled in app settings and the websocket is reconnected for some reason or app is restarted, the server will have already running cron agent job for monitoring. But in reconnection the cron scheduler is recalled with same cron id making websocket disconnect.

Fix:

  • Add check before calling cron agent scheduler , whether it's already running or not with same id.
  • Also when Toggles down the auto email monitoring option then the scheduler should be cancelled, which is not yet implemented.

Structure:
As the auto email monitoring, is made with keeping in mind that the app will be running in background for certain tasks. And the cron agent doesn't get cancelled when the app is closed. So when the app is closed cron agent works in background and notification are send in case of new mails. (+TTS future).

So, here's the structure

  • - Remove scheduling of cron agent from chat websocket connection.
  • - In app whenever user logins based on data send from server (previous or default preference of user) call the start cron scheduler api endpoint. (Also add logic to check if existing job is running for same id)
  • - When user turns it off manually from settings call end cron scheduler api endpoint.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions