# How Message Logger works ## Server sync and caching The server only points at copies (logger/activity group message ids); the client reads them through its own session, so the account must be a member of those groups. The server is asked about a chat only when needed: when it wasn't checked within the last hour (from the oldest loaded message on; the answer replaces the chat's cached marks), when older history is loaded past the checked range (that part only), or after an edit/delete event in the chat. Answers hold at most 100 marks (edited/deleted) and 100 missing ids, newest first. Marks are cached per chat in the plugin's SQLite (`state.db`, no size cap), so a chat opened again — even offline — shows them at once, and deleted messages are restored from the cache. An expired chat keeps its cache until the next successful check, which replaces it and starts over. Cached answers older than *Cache lifetime* (1/7/30/90/365 days or never; 30 by default) are removed, checked once a day (from local midnight) and when the setting changes.