tgcli
tgcli copied to clipboard
Remove legacy dialog-cache seeding (refreshChannelsFromDialogs) and the auth/sync conflation
Two likely-legacy bits to investigate/remove:
- Dialog-cache seeding.
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/sync conflation.
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).