Skip to content

Daemon doesn't close clients on shutdown or after a failed first connect #34

Closed

Description

@neoromantic

Found while fixing #16. closeClientSafe now calls destroy() (mtcute 0.32 has no close()), but two paths still leave clients open:

  • disconnectAllAccounts (graceful shutdown) never closes the accounts' clients, so session storage isn't flushed and closed. That can leave update state stale for the next start.
  • connectAccount doesn't close the client when the first start() or getMe() fails.

Fix: close every client through closeClientSafe in both paths.

Done when unit tests show destroy() called once per client on shutdown and after a failed connect.

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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions