fix(peer): coalesce full UI view publications

Keep one queued and one replaceable pending snapshot for remote-library and Call-to-Play views while preserving lifecycle-event FIFO delivery. Generation barriers and fenced drains prevent stale nonempty views from crossing disable or acknowledgement boundaries.

Test Plan:
- just test
- just clippy
- focused burst, lifecycle ordering, fence, repeated-barrier, and stale-view tests
- independent ordering review
- git diff --check
This commit is contained in:
ddidderr committed 2026-09-12 13:06:10 +02:00
1 parent 470e119515
commit 37420e26ed
17 files changed
+828 -251

No files matched your search

@@ -12,13 +12,14 @@ use futures::{StreamExt as _, stream::FuturesUnordered};
use lanspread_mdns::{LANSPREAD_SERVICE_TYPE, MdnsBrowser, MdnsService, MdnsServicePoll};
use lanspread_proto::{PROTOCOL_VERSION, PeerEndpoint, PeerId};
use tokio::sync::{
mpsc::{self, UnboundedSender},
mpsc,
oneshot,
};
use tokio_util::sync::CancellationToken;
use crate::{
PeerEvent,
PeerEventSender,
context::NetworkServiceCtx,
events,
services::{
@@ -188,7 +189,7 @@ impl Drop for DiscoveryWorker {
/// Runs the peer discovery service using mDNS.
#[allow(clippy::too_many_lines)]
pub async fn run_peer_discovery(
tx_notify_ui: UnboundedSender<PeerEvent>,
tx_notify_ui: PeerEventSender,
ctx: NetworkServiceCtx,
) -> eyre::Result<()> {
log::info!("Starting peer discovery task");