Repository navigation
Conversation
Tiny Code Reviewthe AI provider rate-limited the request This is advice, not a gate. Re-run with the |
unRekable
left a comment
There was a problem hiding this comment.
Code Review
🟡 1 finding (0 blocking).
The fix persists where each placed Telegram message lives, using the existing per-account note store, and clears that note (and the in-memory entry) when a delete is applied, so a delete still names its chat after a reconnect or restart. The design holds: note keys cannot collide across the two id spaces (channel ids carry a c-prefix), clearing writes an empty value that remembered() filters, and the new integration test drives a real process restart so it fails on main without the change. The one real defect is growth: place() now writes one note row for every message seen, nothing sweeps that family, and the store's retention prunes the messages these notes shadow but never the notes themselves.
Residual risk
- delete() resolves the peer from the conversation, so deleting a discussion-group comment (conversation cX_Y, message peer gY) clears the note tg-msg:cX:{id} while place keyed it tg-msg:{id}; the residue is harmless only because Telegram ids are never reused and the delete echo's forget_placed(None, id) clears the right key.
- forget_placed always writes set_note(key, ""), so deletes in plain channels and private chats create empty rows even where no note existed; INSERT OR REPLACE keeps them and remembered() filters the empty value on read, so this is stray rows only.
- Notes exist only for messages seen after this build first runs; messages seen before the upgrade still go only when their conversation is reopened, so the old behavior lingers for existing stores.
| return; | ||
| } | ||
| let channel = matches!(who, Who::Channel(_)).then(|| who.text()); | ||
| self.ctx.set_note(&message_note(channel.as_deref(), message), conversation); |
There was a problem hiding this comment.
…nect removes it. Closes #515
49b170a to
4c5be76
Compare
What changed and why
A message deleted in a private Telegram chat is removed even after the app has reconnected. The chat a message belongs to is kept with the message, so a delete that names only the message id can still find it. A cleared place is not reused for a later message.
Type
Platforms
Proof
Scenario: e2e/scenarios/telegram-delete-placed
Lab run:
Compatibility
No protocol change. An older client still drops a private delete that arrives after a reconnect until that chat is opened again.
Risk and rollback
A wrong remembered chat would remove a message from the wrong conversation. Revert this change.
Release note
A Telegram message deleted in a private chat is removed even if the app reconnected first.
Tested with
cargo test -p chatd --no-default-features --test telegram a_private_delete_after_reconnectandcargo clippy -p chatd --no-default-features --all-targets. No live Telegram account. The lab was not run.Closes #515