Repository navigation
Conversation
dallo28
force-pushed
the
fix/siri-unread-outgoing
branch
from
October 27, 2026 14:19
a0f5530 to
06aa273
Compare
The unread scan decided "unread" from the incoming read marker alone. That marker only moves when a chat is read, so a reply sent from CarPlay, Siri or a notification stays above it, and Siri read it out ahead of the answer to it (bugs.telegram.org/c/66638). 13.0 extended the scan from private chats to groups and channels, where this is the usual case. Read out only incoming messages, plus reminders: scheduled messages delivered to Saved Messages, which notify like received ones. The rule applies to the unread scan and to getMessages, which serves notification read-outs. Adds IntentMessageReadabilityTests and group and reminder cases to UnreadMessagesScanTests.
dallo28
force-pushed
the
fix/siri-unread-outgoing
branch
from
October 27, 2026 14:21
06aa273 to
85e8dc6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes https://bugs.telegram.org/c/66638: since 13.0, CarPlay/Siri reads the user's own last message before the reply to it.
Cause
When Siri asks for unread messages, the scan in
unreadMessages(views:)treats a message as unread when it is above the chat's incoming read marker (isIncomingMessageIndexRead). It does not check whether the message is incoming. The marker only moves when a chat is read. Opening a chat reads it up to the newest message, the user's own included. A reply sent from CarPlay, Siri or a notification does not move it. That reply stays above the marker, and when the next message arrives the scan returns both, and Siri reads the user's message first.Private chats had this flaw before 13.0 as well. 13.0 extended the scan from private chats to groups and channels (
unreadMessagesIncludePeer). In a group, the user's message followed by other people's replies is the usual case, so the bug now shows up all the time.Change
intentMessageIsReadable: a message may be read out if it is incoming, or if it is a reminder. A reminder is a scheduled message delivered to Saved Messages (.WasScheduledin the account's own chat). It notifies and counts as unread like a received message.getMessagesboth use this rule.getMessageshandles notification read-outs, so reminder notifications keep being read. Ordinary saved messages, and scheduled messages sent to other chats, stay out.IntentMessageReadabilityTestscovers the rule.UnreadMessagesScanTestsadds three cases: the user's own reply in a private chat, the user's own message in a group with replies after it, and a reminder next to an ordinary saved message.Testing
Not compiled or run: my checkout has no submodules or codesigning access, so only
swiftc -parsewas run on the changed files. Please run//Telegram:IntentsExtensionTests(Make.py test --target //Telegram:IntentsExtensionTests). No device test in CarPlay.