Skip to content

Siri: don't read out the account's own messages - #2381

Open
dallo28 wants to merge 1 commit into
TelegramMessenger:masterfrom
dallo28:fix/siri-unread-outgoing
Open

dallo28 wants to merge 1 commit into
TelegramMessenger:masterfrom
dallo28:fix/siri-unread-outgoing

Conversation

@dallo28

@dallo28 dallo28 commented Oct 19, 2026 •

Copy link
Copy Markdown

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

  • New 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 (.WasScheduled in the account's own chat). It notifies and counts as unread like a received message.
  • The unread scan and getMessages both use this rule. getMessages handles notification read-outs, so reminder notifications keep being read. Ordinary saved messages, and scheduled messages sent to other chats, stay out.
  • Tests:
    • IntentMessageReadabilityTests covers the rule.
    • UnreadMessagesScanTests adds 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 -parse was run on the changed files. Please run //Telegram:IntentsExtensionTests (Make.py test --target //Telegram:IntentsExtensionTests). No device test in CarPlay.

@dallo28 dallo28 closed this Oct 19, 2026
@dallo28 dallo28 reopened this Oct 27, 2026
@dallo28
dallo28 force-pushed the fix/siri-unread-outgoing branch from a0f5530 to 06aa273 Compare October 27, 2026 14:19
@dallo28 dallo28 changed the title Siri: read out only incoming messages Oct 27, 2026
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
dallo28 force-pushed the fix/siri-unread-outgoing branch from 06aa273 to 85e8dc6 Compare October 27, 2026 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant