From 4d88660d91e3f79e077d4365ba6743826c6f8028 Mon Sep 17 00:00:00 2001 From: spinline Date: Mon, 9 Feb 2026 22:07:44 +0300 Subject: [PATCH] debug: add SSE logging to trace torrent loading issue --- frontend/src/store.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontend/src/store.rs b/frontend/src/store.rs index cf6fe20..5f4d63a 100644 --- a/frontend/src/store.rs +++ b/frontend/src/store.rs @@ -114,7 +114,9 @@ pub fn provide_torrent_store() { Effect::new(move |_| { let user_val = user.get(); + log::debug!("SSE Effect: user = {:?}", user_val); if user_val.is_none() { + log::debug!("SSE Effect: user is None, skipping connection"); return; } @@ -151,6 +153,7 @@ pub fn provide_torrent_store() { if let Ok(event) = serde_json::from_str::(&data_str) { match event { AppEvent::FullList { torrents: list, .. } => { + log::debug!("SSE: Received FullList with {} torrents", list.len()); torrents.update(|map| { let new_hashes: std::collections::HashSet = list.iter().map(|t| t.hash.clone()).collect(); map.retain(|hash, _| new_hashes.contains(hash)); @@ -158,6 +161,7 @@ pub fn provide_torrent_store() { map.insert(new_torrent.hash.clone(), new_torrent); } }); + log::debug!("SSE: torrents map now has {} entries", torrents.with(|m| m.len())); } AppEvent::Update(update) => { torrents.update(|map| {