From d907aa53f41b74ec25ea00a17ce93f55f11cf111 Mon Sep 17 00:00:00 2001 From: Levi Neely <141506390+lneely@users.noreply.github.com> Date: Sat, 18 Jul 2026 17:32:53 +0200 Subject: [PATCH] dbus: fix streaming performance - sendNotification now async (fire-and-forget goroutine) - ChatUpdated coalescing interval 50ms -> 150ms to reduce signal flood --- main.go | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/main.go b/main.go index 292954f..e00dbf2 100644 --- a/main.go +++ b/main.go @@ -73,7 +73,7 @@ func (e *chatEmitter) append(text string) { e.buf += text if !e.running { e.running = true - e.timer = time.AfterFunc(50*time.Millisecond, e.flush) + e.timer = time.AfterFunc(150*time.Millisecond, e.flush) } e.mu.Unlock() } @@ -707,17 +707,19 @@ func (m *SessionManager) DismissDetached(sessionID string, pid int32) (bool, *db // --- Notifications --- func (m *SessionManager) sendNotification(title, body string) { - obj := m.conn.Object("org.freedesktop.Notifications", "/org/freedesktop/Notifications") - obj.Call("org.freedesktop.Notifications.Notify", 0, - "ollie-dbus", // app_name - uint32(0), // replaces_id - "system-run", // app_icon - title, // summary - body, // body - []string{}, // actions - map[string]dbus.Variant{}, // hints - int32(5000), // timeout ms - ) + go func() { + obj := m.conn.Object("org.freedesktop.Notifications", "/org/freedesktop/Notifications") + obj.Call("org.freedesktop.Notifications.Notify", 0, + "ollie-dbus", // app_name + uint32(0), // replaces_id + "system-run", // app_icon + title, // summary + body, // body + []string{}, // actions + map[string]dbus.Variant{}, // hints + int32(5000), // timeout ms + ) + }() } // --- Session Persistence ---