mirror of
https://github.com/Studio-Saelix/sencho.git
synced 2026-08-30 12:09:15 +00:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user