commit 22c4e29ea0a36009d6b36595edbed732f081082a
parent fd57c234fedb084d52739643b0efaa39d48aa8d9
Author: William Casarin <jb55@jb55.com>
Date: Tue, 17 Feb 2026 14:09:31 -0800
fix missing relay events and duplicate sessions in dave app
Dave was not calling try_process_events_core, so relay events (including
PNS-wrapped session data) only got ingested when the columns app was
active. Also fix duplicate session creation when multiple state events
for the same session arrive in one poll batch.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat:
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/crates/notedeck_dave/src/lib.rs b/crates/notedeck_dave/src/lib.rs
@@ -30,7 +30,7 @@ use egui_wgpu::RenderState;
use enostr::KeypairUnowned;
use focus_queue::FocusQueue;
use nostrdb::{Subscription, Transaction};
-use notedeck::{ui::is_narrow, AppAction, AppContext, AppResponse};
+use notedeck::{try_process_events_core, ui::is_narrow, AppAction, AppContext, AppResponse};
use std::collections::{HashMap, HashSet};
use std::path::PathBuf;
use std::string::ToString;
@@ -1304,7 +1304,7 @@ You are an AI agent for the nostr protocol called Dave, created by Damus. nostr
};
// Collect existing claude session IDs to avoid duplicates
- let existing_ids: std::collections::HashSet<String> = self
+ let mut existing_ids: std::collections::HashSet<String> = self
.session_manager
.iter()
.filter_map(|s| {
@@ -1378,6 +1378,8 @@ You are an AI agent for the nostr protocol called Dave, created by Damus. nostr
claude_sid
);
+ existing_ids.insert(claude_sid.to_string());
+
let dave_sid = self.session_manager.new_resumed_session(
cwd,
claude_sid.to_string(),
@@ -1833,6 +1835,9 @@ impl notedeck::App for Dave {
fn update(&mut self, ctx: &mut AppContext<'_>, ui: &mut egui::Ui) -> AppResponse {
let mut app_action: Option<AppAction> = None;
+ // Process relay events into ndb (needed when dave is the active app)
+ try_process_events_core(ctx, ui.ctx(), |_, _| {});
+
// Poll for external spawn-agent commands via IPC
self.poll_ipc_commands();