Two likely-legacy bits to investigate/remove:
- Dialog-cache seeding.
seedArchiveInBackground() (mcp-server.js) calls messageSyncService.refreshChannelsFromDialogs() → telegramClient.listDialogs(0), iterating ALL dialogs (1358 on a large account) and upserting them into a channels registry at startup. It's slow on large accounts (it was the cold-start culprit, now backgrounded). Is this cache still needed? The archive already stores + watches dialogs, and ops fetch dialogs live. Investigate dropping it (rely on archive + live), or making it incremental/on-demand.
- auth/sync conflation.
auth --follow (plus auth's --idle-exit / --download-media) makes auth run a sync worker after login — conflating authentication with syncing. Auth should only log in + write the session (bootstrap); syncing is the server's job. Remove auth --follow and the auth-time sync.
Refs: mcp-server.js (seedArchiveInBackground), message-sync-service.js (refreshChannelsFromDialogs/listDialogs), cli.js (auth). Ties into the writer-consolidation (#45 Step 2).
Two likely-legacy bits to investigate/remove:
seedArchiveInBackground()(mcp-server.js) callsmessageSyncService.refreshChannelsFromDialogs()→telegramClient.listDialogs(0), iterating ALL dialogs (1358 on a large account) and upserting them into achannelsregistry at startup. It's slow on large accounts (it was the cold-start culprit, now backgrounded). Is this cache still needed? The archive already stores + watches dialogs, and ops fetch dialogs live. Investigate dropping it (rely on archive + live), or making it incremental/on-demand.auth --follow(plus auth's--idle-exit/--download-media) makesauthrun a sync worker after login — conflating authentication with syncing. Auth should only log in + write the session (bootstrap); syncing is the server's job. Removeauth --followand the auth-time sync.Refs:
mcp-server.js(seedArchiveInBackground),message-sync-service.js(refreshChannelsFromDialogs/listDialogs),cli.js(auth). Ties into the writer-consolidation (#45 Step 2).