Repository navigation
v0.5.0
Stop the daemon before you upgrade and start it again after: the first open
of a cache moves its search index to the new format (#1). Then run
tg db vacuum once with the daemon stopped, to give the old index's space
back to the disk.
Added
- The cache no longer only grows.
tg statusshows each account's cache
size, its WAL and the free space inside it, andtg status --sizesadds the
size of each table. The daemon now deletes old API activity, expired
rate-limit windows and old finished and failed sync jobs on a schedule;
until now nothing pruned the first two, so they grew forever. How long it
keeps each is set inconfig.jsonundercache.retention, and it never
forgets a FLOOD_WAIT that is still running. The new
tg db vacuum [--account]gives free space back to the disk and reports the
bytes before and after. It works while the daemon runs on caches created by
this version, and older caches need one run with the daemon stopped. Where
SQLite is 3.43 or newer, the search index no longer keeps its own copy of
every message's text, sender and chat, which makes a cache about 11–18%
smaller;tg messages searchresults stay the same (#1). - The daemon now keeps each account's contact list current. On each start
and reconnect, and then every peer TTL (cache.staleness.peers, one week by
default), it checks the list in the background with a hash, so an unchanged
list costs one tiny reply and no contact writes. The first start after the
upgrade fetches the full list once. Contacts added or removed on another
device while it runs are applied when Telegram sends the update. The check
covers who is a contact; names, usernames and phones still refresh with a
changed list ortg contacts list --fresh(#8).
Changed
tg sqlqueries that read the search index's own columns
(message_search.text,sender,chat,files) now getNULL, and
snippet()andhighlight()over it no longer work, because the index
keeps no copy of the text (#1). Joinmessages_cacheby rowid for the text,
astg messages searchdoes. Getting snippets back is #81.
Fixed
- With several accounts, the daemon ran one sync job at a time over all of
them, so while one account's job waited out a FLOOD_WAIT (up to 5 minutes),
every other account's sync stopped too, and with three or more busy
accounts each one synced more slowly than alone. Each account now runs its
own jobs, one at a time and 3 seconds apart as before, so one account's
FLOOD_WAIT or slow page no longer holds the others, andtg daemon stop
still ends every account's wait at once (#60). tg chats list --type communityfound no communities: Telegram lists a
joined community apart from the other dialogs, and the daemon's dialog pass
andtg chats list --freshskipped it. Both now also cache every community
the account joined, with its access hash, at the cost of one extra request.
If that request fails, a FLOOD_WAIT included (it is not waited out), the
dialogs are still cached and the next pass retries. A community has no
messages of its own, sotg chats sync <community>no longer turns sync on
for jobs that would fail: it exits withINVALID_ARGSand points at the
community's linked chats, which sync as ordinary supergroups and channels.
If an earlier version turned the community on, the error says that--auto
turns it off and clears its failed jobs (#58).- A contact removed on Telegram stayed marked as a contact for good, even
aftertg contacts list --fresh. The daemon and--freshnow unmark it and
keep the user row (#8).