Skip to content

Reconnect doesn't restore real-time updates #16

Closed

Description

@neoromantic

attemptReconnect in src/daemon/daemon-accounts.ts creates a new client, but:

  • it never calls setupEventHandlers or client.startUpdatesLoop(), so new messages stop arriving;
  • it doesn't close the old client, so two clients use the same session file;
  • the sync worker keeps the old client (src/daemon/daemon-scheduler.ts), so jobs run on a dead connection.

The daemon looks healthy in tg status, but after one failed health check it quietly stops caching new messages.

Fix: on reconnect, remove the handlers from the old client and close it, register the handlers on the new client, start its updates loop, and rebuild the account's sync worker.

Done when a test that forces a reconnect shows a live message being cached afterwards.

Activity

  1. added
    bug
    on Oct 21, 2026
  2. added a commit that references this issue on Oct 21, 2026
    c494622
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