Skip to content

Backfill sync doesn't run #6

Closed

Description

@neoromantic

History backfill doesn't run on a real account.

Every refresh, refreshQueues (src/daemon/scheduler.ts) queues a forward catch-up for every sync-enabled chat, at the top priority. The daemon runs at most one job every 3 seconds, so catch-ups always win. On a real account with about 1,860 sync-enabled chats, a daemon run completed 103 forward_catchup jobs and no initial_load or backward_history job. A scheduler simulation with 20+ chats gives the same result over an hour.

Also against docs/sync-strategy.md and AGENTS.md:

  • "Large groups and channels sync only on request" has no trigger: setSyncEnabled has no callers, and the startup dialog pass overwrites sync_enabled every time (src/db/chat-sync-state.ts).
  • Groups of 20–100 members: AGENTS.md says the last 10 messages, while the code and docs/sync-strategy.md use 100.
  • A group whose dialog has no member count is treated as small, so it can get a full-history sync.

To do:

Done when a scheduler test with 500 chats shows backfill progress next to catch-ups, and a live daemon run completes initial_load jobs.

Original note: check what's been done, implement what hasn't, write comprehensive tests, recheck rate limit support.

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