improve crash logs

This commit is contained in:
KingKDot
2026-06-30 14:35:27 -05:00
parent b5b50aa038
commit 01ecab779e
10 changed files with 136 additions and 10 deletions
+5 -2
View File
@@ -2067,6 +2067,7 @@ export type NotificationRow = {
title: string;
process?: string;
processPath?: string;
detail?: string;
pid?: number;
keyword?: string;
category: string;
@@ -2077,8 +2078,8 @@ export type NotificationRow = {
export function saveNotification(record: NotificationRow) {
db.run(
`INSERT OR REPLACE INTO notifications
(id, client_id, host, user, os, title, process, process_path, pid, keyword, category, ts, screenshot_id)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`,
(id, client_id, host, user, os, title, process, process_path, detail, pid, keyword, category, ts, screenshot_id)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`,
record.id,
record.clientId,
record.host ?? null,
@@ -2087,6 +2088,7 @@ export function saveNotification(record: NotificationRow) {
record.title,
record.process ?? null,
record.processPath ?? null,
record.detail ?? null,
record.pid ?? null,
record.keyword ?? null,
record.category,
@@ -2116,6 +2118,7 @@ export function getNotificationHistory(limit: number = 500): NotificationRow[] {
title: row.title,
process: row.process ?? undefined,
processPath: row.process_path ?? undefined,
detail: row.detail ?? undefined,
pid: row.pid ?? undefined,
keyword: row.keyword ?? undefined,
category: row.category,
+4
View File
@@ -393,6 +393,7 @@ db.run(`
title TEXT NOT NULL,
process TEXT,
process_path TEXT,
detail TEXT,
pid INTEGER,
keyword TEXT,
category TEXT NOT NULL DEFAULT 'active_window',
@@ -400,6 +401,9 @@ db.run(`
screenshot_id TEXT
);
`);
try {
db.run(`ALTER TABLE notifications ADD COLUMN detail TEXT`);
} catch {}
db.run(`CREATE INDEX IF NOT EXISTS idx_notifications_ts ON notifications(ts DESC);`);
db.run(`CREATE INDEX IF NOT EXISTS idx_notifications_client_id ON notifications(client_id);`);