Skip to content

Sync jobs drop the senders and the message count of each history page #126

Closed

Description

@neoromantic

Found while running the 0.8.0 daemon for a day on a real account.

fetchHistoryPage (src/daemon/sync-worker-real-helpers.ts) returns the page's messages, count and users, but the sync jobs store only the messages:

  • Senders aren't cached. 1,135 senders of 71,348 cached messages (about 9%, nearly all in groups and supergroups) have no users_cache row. Search results show no sender name for them, and --sender @username or sender:name can't find their messages. The CLI's own history path (cacheHistoryResponse) does cache the senders.
  • count is dropped. chat_sync_state.total_messages is NULL for all 2,940 chats, so nothing can say how much history is left. tg status shows chats pending, not messages, and no estimate.

Proposed:

  • Sync jobs cache the page's users (and chats) the way cacheHistoryResponse does, so later messages index the sender's name. Messages already cached keep their index until Search: re-index older messages after a person or chat is renamed #93 re-indexes them.
  • Store count in total_messages and show history progress in tg status (messages cached of messages known, per account and for the biggest pending chats).

Done when tests show a history page's users cached and total_messages set, and tg status reports the progress. Related: #93.

Activity

  1. added
    bug
    on Oct 30, 2026
  2. added 2 commits that reference this issue on Oct 30, 2026
    bcd781f
    0c6b29b
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