You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Delete events without chat context can skip valid deletions #7
Telegram sends some delete updates (private chats and basic groups) with message IDs only, no chat ID. When the same message ID exists in more than one cached chat, the daemon can't tell which message was deleted and may skip a valid deletion. Find a safe way to resolve these (for example, by tracking the per-account message ID space) and add tests.
Checked on 2026-10-21: onDeleteMessage in src/daemon/daemon-accounts.ts looks the ID up across every cached chat, channels included, and silently skips the delete when more than one chat has it (src/db/messages-cache.ts).
Private chats and basic groups share one message-ID sequence per account. Once the cache is per account (#17), excluding channel IDs makes the match unique. The lookup also needs an index on message_id: today it scans the whole table.
With #59 (#17) each account has its own cache, and a delete update lands only in the cache of the account that received it. So a delete without chat context no longer touches another account's message with the same ID; that part is covered by a test in daemon-accounts.connect.test.ts.
What remains inside one account: the lookup in src/db/messages-cache.ts still matches the ID across every cached chat of that account, channels included, skips the delete when more than one chat has it, and scans the table without an index on message_id. Private chats and basic groups share one message-ID sequence per account, so excluding channel chat IDs (-100…) from the match should make it unique; that and the index are still to do.
Activity
neoromantic commentedon Oct 21, 2026
Checked on 2026-10-21:
onDeleteMessageinsrc/daemon/daemon-accounts.tslooks the ID up across every cached chat, channels included, and silently skips the delete when more than one chat has it (src/db/messages-cache.ts).Private chats and basic groups share one message-ID sequence per account. Once the cache is per account (#17), excluding channel IDs makes the match unique. The lookup also needs an index on
message_id: today it scans the whole table.neoromantic commentedon Oct 21, 2026
With #59 (#17) each account has its own cache, and a delete update lands only in the cache of the account that received it. So a delete without chat context no longer touches another account's message with the same ID; that part is covered by a test in
daemon-accounts.connect.test.ts.What remains inside one account: the lookup in
src/db/messages-cache.tsstill matches the ID across every cached chat of that account, channels included, skips the delete when more than one chat has it, and scans the table without an index onmessage_id. Private chats and basic groups share one message-ID sequence per account, so excluding channel chat IDs (-100…) from the match should make it unique; that and the index are still to do.docs: add the changelog entries for the 0.4.0 bug fixes