fix: preserve original relay label through multi-hop presence propagation
Some checks failed
Mirror to GitHub / mirror (push) Failing after 35s
Build Release Binaries / build-amd64 (push) Failing after 7m26s

When propagating GlobalRoomActive to other peers, use tagged participants
(with relay_label set to the originating relay) instead of the raw
untagged participants. This shows "Relay C" instead of "Relay B" when
C's participants are forwarded through hub B to A.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Siavash Sameni
2026-04-08 15:34:22 +04:00
parent c3bd657224
commit c92db7e9b7

View File

@@ -675,12 +675,24 @@ async fn handle_signal(
}).collect(); }).collect();
link.remote_participants.insert(room.clone(), tagged); link.remote_participants.insert(room.clone(), tagged);
} }
// Propagate to other peers // Propagate to other peers (with relay labels preserved)
let tagged_for_propagation = if let Some(link) = links.get(peer_fp) {
let label = link.label.clone();
participants.iter().map(|p| {
let mut t = p.clone();
if t.relay_label.is_none() {
t.relay_label = Some(label.clone());
}
t
}).collect::<Vec<_>>()
} else {
participants.clone()
};
for (fp, link) in links.iter() { for (fp, link) in links.iter() {
if fp != peer_fp { if fp != peer_fp {
let _ = link.transport.send_signal(&SignalMessage::GlobalRoomActive { let _ = link.transport.send_signal(&SignalMessage::GlobalRoomActive {
room: room.clone(), room: room.clone(),
participants: participants.clone(), participants: tagged_for_propagation.clone(),
}).await; }).await;
} }
} }