fix: dedup filter collision between different senders + build scripts default --pull
Some checks failed
Mirror to GitHub / mirror (push) Failing after 35s
Build Release Binaries / build-amd64 (push) Failing after 1m53s

- Dedup key now includes source peer fingerprint hash, preventing
  packets from different senders with same room+seq from being dropped
  as duplicates (was silently killing all multi-hop audio)
- Build scripts default to --pull (use --no-pull to skip)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Siavash Sameni
2026-04-08 15:18:52 +04:00
parent 2eab56beec
commit 8b79cdc6fc
3 changed files with 17 additions and 5 deletions

View File

@@ -55,8 +55,10 @@ impl Deduplicator {
}
/// Returns true if this packet is a duplicate (already seen).
fn is_dup(&mut self, room_hash: &[u8; 8], seq: u16) -> bool {
let key = u64::from_be_bytes(*room_hash) ^ (seq as u64);
/// The source_fp_hash distinguishes packets from different senders
/// that share the same room and seq number.
fn is_dup(&mut self, room_hash: &[u8; 8], seq: u16, source_fp_hash: u64) -> bool {
let key = u64::from_be_bytes(*room_hash) ^ (seq as u64) ^ source_fp_hash;
if self.seen.contains(&key) {
return true;
}
@@ -850,9 +852,17 @@ async fn handle_datagram(
}
// Dedup: drop packets we've already seen (multi-path duplicates)
// Include source peer fingerprint so different senders with same seq aren't confused
let source_fp_hash = {
let mut h = 0u64;
for (i, b) in source_peer_fp.bytes().enumerate().take(8) {
h ^= (b as u64) << ((i % 8) * 8);
}
h
};
{
let mut dedup = fm.dedup.lock().await;
if dedup.is_dup(&rh, pkt.header.seq) {
if dedup.is_dup(&rh, pkt.header.seq, source_fp_hash) {
return;
}
}