Open Client

`open_client` is handled directly in the WebSocket consumer. It does not go through the command registry.

Flow: Open Client

Summary

open_client is handled directly in the WebSocket consumer. It does not go through the command registry.

Sequence

sequenceDiagram participant UI as Client participant WS as TDLibListChatsConsumer participant NATS as Core NATS participant OWNER as AccountOwnerWorker participant SNAP as CacheProjectionUpdater participant REPLAY as ReplayService UI->>WS: {"action": "open_client", "userbot_id": 1} WS->>NATS: subscribe to rt.* for account 1 WS->>OWNER: ensure_warm WS->>SNAP: get_snapshot(1) SNAP-->>WS: profile + chat list snapshot WS->>REPLAY: replay_account(1) REPLAY-->>WS: recent events WS-->>UI: snapshot events WS-->>UI: replay events OWNER-->>WS: future live events WS-->>UI: chat_update

Files involved

  • backend/tg_client/dialogs/ws/list_chats/consumers.py
  • backend/tg_client/projections/updater.py
  • backend/tg_client/replay/service.py
  • backend/tg_client/account_runtime/owner_worker.py

Notes

  • open_client may subscribe to multiple userbot_ids
  • the gateway uses a watcher id to keep the runtime warm
  • snapshot + replay is the current recovery path; dedicated TG event replay workers are not implemented here