fix: reconcile stale broadcast channel name from QR invite#8251
Closed
bolstad wants to merge 1 commit into
Closed
Conversation
Outgoing broadcast channels (`Chattype::OutBroadcast`) were created without `Param::GroupNameTimestamp`, so their outgoing messages never carried a `Chat-Group-Name-Timestamp` header. A member who joins a channel via a QR invite takes the channel name from the invite's `b=` parameter (`joining_chat_id()` -> `create_multiuser_record()`). Without a timestamp header on incoming channel messages, `apply_chat_name_avatar_and_description_changes()` skips the name-update block entirely, so that name is never reconciled with the channel's actual name. The joining device then shows the name embedded in the invite link forever, even though every other client shows the correct name. Stamp `GroupNameTimestamp` at channel creation in `create_out_broadcast_ex()` so every channel message advertises the name with a timestamp, and add migration 153 to backfill existing outgoing broadcast channels. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Author
|
This is a fix for #8250 |
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.
Closes #8250
Problem
When a user joins a broadcast channel via a QR invite link
(
https://i.delta.chat/#...), the joining device displays the channelname taken from the link's
b=parameter and never reconciles itwith the channel's actual name. If the two differ (e.g. the channel was
renamed after the link was generated, or an older link was shared), the
joining device shows the wrong name permanently — even after receiving
messages and membership events from the channel. Every other client
shows the correct name.
Root cause
check_qrparses the link'sb=parameter intoQr::AskJoinBroadcast { name }.joining_chat_id()creates the localInBroadcastchatwith that name via
create_multiuser_record(); the chat'sParam::GroupNameTimestampis left unset (0).create_out_broadcast_ex()creates the owner'sOutBroadcastchatwithout setting
Param::GroupNameTimestamp. Channels are alwayspromoted, so the first-message promotion path in
chat.rsthat setsthe timestamp for
Group | OutBroadcastis never reached.mimefactoryemitsChat-Group-Namebut neverChat-Group-Name-Timestampfor channel messages.apply_chat_name_avatar_and_description_changes()only enters thename-update block when the message carries a
Chat-Group-Name-Timestamp(orChat-Group-Name-Changed) header.With neither present, the QR-derived name is never overwritten.
Fix
create_out_broadcast_ex()now stampsParam::GroupNameTimestampatchannel creation, so every outgoing channel message advertises the
name with a timestamp and joiners can reconcile a stale name.
Param::GroupNameTimestampon existingoutgoing broadcast channels.
This keeps the "broadcast channels are always promoted" invariant
intact (
Param::Unpromotedis untouched).Testing
test_secure_join_broadcast_reconciles_stale_namejoins a channel with a manipulated (stale)
b=parameter and assertsthe name is reconciled after a regular channel post. It fails without
the
chat.rschange and passes with it.test_broadcasts_name_and_avatar(which asserts channels are always promoted) and
test_broadcast_change_name.cargo fmtclean.Disclosure
As my Rust knowledge is weak, I have created this patch with help of
Claude Code. Please take this under consideration when reviewing.