From 03b6f411ade12acf8c290695199afc44ecc2795b Mon Sep 17 00:00:00 2001 From: DeFiDude <59237470+DeFiDude@users.noreply.github.com> Date: Wed, 18 Nov 2026 12:55:10 -0700 Subject: [PATCH] discovery: the receiver registers its announce type --- crates/rns-runtime/src/reticulum.rs | 6 ++++++ .../src/reticulum/tests/paths_and_filters.rs | 20 +++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/crates/rns-runtime/src/reticulum.rs b/crates/rns-runtime/src/reticulum.rs index 66e0594..a4bf181 100644 --- a/crates/rns-runtime/src/reticulum.rs +++ b/crates/rns-runtime/src/reticulum.rs @@ -7701,6 +7701,12 @@ async fn start_on_network_discovery(handle: ReticulumHandle) { if !*started { *started = true; drop(started); + // InterfaceDiscovery registers its announce type (Discovery.py). + handle + .wants_destination_type( + rns_transport::discovery::constants::DISCOVERY_ASPECT_FILTER, + ) + .await; let (observer_tx, observer_rx) = if handle.config.autoconnect_discovered_interfaces > 0 { diff --git a/crates/rns-runtime/src/reticulum/tests/paths_and_filters.rs b/crates/rns-runtime/src/reticulum/tests/paths_and_filters.rs index 4cafd6e..ece6f68 100644 --- a/crates/rns-runtime/src/reticulum/tests/paths_and_filters.rs +++ b/crates/rns-runtime/src/reticulum/tests/paths_and_filters.rs @@ -172,3 +172,23 @@ fn blocked_ips_lines_parse_like_upstream() { .collect(); assert_eq!(parsed, ["198.51.100.7", "2001:db8::1", "::1"]); } + +/// Discovery.py 1.6.1 (884f109b): the receiver wants its announce type, so +/// `required_only` does not drop discovery announces. +#[tokio::test] +async fn interface_discovery_registers_its_announce_type() { + let (mut handle, _actor) = discovery_actor(); + let dir = tempfile::tempdir().unwrap(); + handle + .install_discovery_store_for_tests(Arc::new(DiscoveryStore::open(dir.path()).unwrap())) + .await; + handle.config.discover_interfaces = true; + handle + .enable_on_network_discovery(Arc::new(StaticStamper)) + .await; + assert!( + handle + .unwants_destination_type(rns_transport::discovery::constants::DISCOVERY_ASPECT_FILTER) + .await + ); +}