fix: purge deleted-stack notifications from panel and ticker (#1674)

* fix: purge deleted-stack notifications from panel and ticker

Stack delete already cascaded scans and drift but left notification_history rows, so the bell and Activity ticker kept showing the deleted stack. Purge those rows in the shared deletion lifecycle, invalidate connected clients, and drop node-scoped in-memory rows immediately.

* fix: target remote notification purge by hub node id

Remote stack-deleted invalidations always reconcile with hub rn.id, and
notification refetch preserves failed node slices instead of wiping them.
This commit is contained in:
Anso
2026-07-22 20:00:45 -04:00
committed by GitHub
parent 394e68671d
commit 698b7d0713
9 changed files with 644 additions and 14 deletions
+6
View File
@@ -4046,6 +4046,12 @@ export class DatabaseService {
stmt.run(nodeId);
}
/** Purge stack-scoped notification history when a stack is deleted. */
public deleteNotificationsForStack(nodeId: number, stackName: string): number {
const stmt = this.db.prepare('DELETE FROM notification_history WHERE node_id = ? AND stack_name = ?');
return stmt.run(nodeId, stackName).changes;
}
public updateNotificationDispatchError(id: number, error: string): void {
this.db.prepare('UPDATE notification_history SET dispatch_error = ? WHERE id = ?').run(error, id);
}