feat(#2569): matrix producer — sweep_unread pushes per-room todos instead of direct wakes

This commit is contained in:
damocles 2026-07-19 01:40:32 +02:00 committed by mara
commit 711e0ece2a
4 changed files with 125 additions and 71 deletions

View file

@ -299,6 +299,11 @@ async fn bring_up_account(
// each sweep (see the sweep fns) so re-invites / new messages re-wake.
let invite_notified = Arc::new(tokio::sync::Mutex::new(std::collections::HashSet::new()));
let unread_notified = Arc::new(tokio::sync::Mutex::new(std::collections::HashSet::new()));
// Startup cancel-and-recreate (loose-ends v2, #2569): wipe this agent's
// matrix todos so stale ones (rooms read while the daemon was down) don't
// linger, then let the first sweep rebuild the set to match current
// unread reality. Best-effort; the sweep converges regardless.
let _ = crate::wake::send_todo_clear(hyperhive_socket, None, true).await;
let sync_loop: SyncLoop = Box::pin(async move {
sync_client
.sync_with_callback(SyncSettings::default(), move |_response| {