From 3e78b290ec2ec2ddb674121722c2ba309f8b2afa Mon Sep 17 00:00:00 2001 From: Jimmy <1fe240cd1a8cf775f6f3060f115e5a303181f3abf28ad4cb0c2515f4a02b36a8@meshllm.communities.buzz.xyz> Date: Thu, 27 Aug 2026 11:54:01 +1000 Subject: [PATCH] fix(mesh): keep closed availability helper test-only The mode-aware resolver replaced the legacy closed-only helper in production. Keep the compatibility wrapper available to its existing closed-mode tests without leaving an unused production export. Co-authored-by: Jimmy <1fe240cd1a8cf775f6f3060f115e5a303181f3abf28ad4cb0c2515f4a02b36a8@meshllm.communities.buzz.xyz> Signed-off-by: Jimmy <1fe240cd1a8cf775f6f3060f115e5a303181f3abf28ad4cb0c2515f4a02b36a8@meshllm.communities.buzz.xyz> --- desktop/src-tauri/src/mesh_llm/discovery.rs | 3 ++- desktop/src-tauri/src/mesh_llm/mod.rs | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/desktop/src-tauri/src/mesh_llm/discovery.rs b/desktop/src-tauri/src/mesh_llm/discovery.rs index ad6db721a9..d347a16d80 100644 --- a/desktop/src-tauri/src/mesh_llm/discovery.rs +++ b/desktop/src-tauri/src/mesh_llm/discovery.rs @@ -232,11 +232,12 @@ fn endpoint_binding_is_valid(event: &nostr::Event, content: &serde_json::Value) .is_ok() } +#[cfg(test)] pub fn availability_from_events(events: Vec) -> MeshAvailability { availability_from_events_for_mode(events, MeshRelayMode::ClosedMembershipEnforced) } -/// [`availability_from_events`], scoped to the relay's membership mode. +/// Resolve availability from relay events, scoped to the relay's membership mode. /// /// On a membership-enforcing relay the NIP-43 snapshot gates routing: a serve /// target is selectable only when its status note is signed by a current diff --git a/desktop/src-tauri/src/mesh_llm/mod.rs b/desktop/src-tauri/src/mesh_llm/mod.rs index e2466b55c9..d6a2b925db 100644 --- a/desktop/src-tauri/src/mesh_llm/mod.rs +++ b/desktop/src-tauri/src/mesh_llm/mod.rs @@ -5,9 +5,11 @@ pub(crate) use coordinator::{publish_current_status_once, publish_stopped_status pub use coordinator::{start_coordinator, MeshCoordinator, KIND_BUZZ_MESH_MEMBER_STATUS}; mod discovery; +#[cfg(test)] +pub use discovery::availability_from_events; pub use discovery::{ - availability_from_events, availability_from_events_for_mode, mesh_status_filter, - owner_ids_from_events, relay_membership_filter, relay_mesh_mode_from_nip11, MeshRelayMode, + availability_from_events_for_mode, mesh_status_filter, owner_ids_from_events, + relay_membership_filter, relay_mesh_mode_from_nip11, MeshRelayMode, }; pub(crate) use discovery::{ current_member_pubkeys, has_membership_snapshot, MESH_STATUS_PAGE_SIZE,