Skip to content

Conversation

@Azq2
Copy link

@Azq2 Azq2 commented Jan 27, 2025

This PR fixes two related but independent issues.

  1. For “system” messages (ActionMessage) the markMentionsRead() is never called.

  2. For messages with albums (which actually consist of multiple messages), markMentionsRead() was called only for the first message, and not for all submessages.

Both these problems create problem, where unread mentions are just accumulated to infinity.

image

In my opinion, this is the most annoying bug in Telegram Web.

@netlify
Copy link

netlify bot commented Jan 27, 2025

👷 Deploy request for telegram-tt-previews pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 19ef1ac

Comment on lines 855 to 861
unreadMentionsIds.push(message.id);
}

if (album) {
for (const albumMessage of album.messages) {
if (albumMessage.hasUnreadMention) {
unreadMentionsIds.push(albumMessage.id);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would duplicate the main message id in albums. You could make unreadMentionIds re-assignable and write it like

if (album) {
  unreadMentionIds = album.messages.filter((msg) => msg.hasUnreadMention).map((msg) => msg.id);
}

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay. I made an improvement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants