From c6d0211240842c348b5d7d4170566c049d01b650 Mon Sep 17 00:00:00 2001
From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com>
Date: Thu, 15 Jan 2026 03:13:30 +0000
Subject: [PATCH] [autofix.ci] apply automated fixes
---
server/notification.js | 5 ++++-
src/components/NotificationDialog.vue | 11 ++++++++---
test/backend-test/test-database-down-notification.js | 7 +++----
3 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/server/notification.js b/server/notification.js
index da4e9f3d2..465038f0d 100644
--- a/server/notification.js
+++ b/server/notification.js
@@ -329,7 +329,10 @@ class Notification {
});
this.cacheLastRefresh = Date.now();
- log.debug("notification", `Refreshed notification cache with ${this.notificationCache.length} notifications (database down opt-in)`);
+ log.debug(
+ "notification",
+ `Refreshed notification cache with ${this.notificationCache.length} notifications (database down opt-in)`
+ );
} catch (e) {
log.error("notification", `Failed to refresh notification cache: ${e.message}`);
// Don't clear the cache if refresh fails, keep using old cache
diff --git a/src/components/NotificationDialog.vue b/src/components/NotificationDialog.vue
index 8f62f3cea..4be3b400d 100644
--- a/src/components/NotificationDialog.vue
+++ b/src/components/NotificationDialog.vue
@@ -129,10 +129,14 @@
-
+
-
+
@@ -422,7 +426,8 @@ export default {
this.notification = JSON.parse(n.config);
// Load send_database_down from database (not stored in config)
if (n.send_database_down !== undefined) {
- this.notification.sendDatabaseDown = n.send_database_down === 1 || n.send_database_down === true;
+ this.notification.sendDatabaseDown =
+ n.send_database_down === 1 || n.send_database_down === true;
} else {
this.notification.sendDatabaseDown = false;
}
diff --git a/test/backend-test/test-database-down-notification.js b/test/backend-test/test-database-down-notification.js
index 1ba4199c8..3a78081b7 100644
--- a/test/backend-test/test-database-down-notification.js
+++ b/test/backend-test/test-database-down-notification.js
@@ -65,8 +65,7 @@ describe("Database Down Notification", () => {
const nonOptInBean = R.dispense("notification");
nonOptInBean.name = "Non-Opt-In Notification";
nonOptInBean.user_id = 1;
- nonOptInBean.config = JSON.stringify({ type: "webhook",
- webhookURL: "https://example.com/webhook2" });
+ nonOptInBean.config = JSON.stringify({ type: "webhook", webhookURL: "https://example.com/webhook2" });
nonOptInBean.active = 1;
nonOptInBean.is_default = 0;
nonOptInBean.send_database_down = 0; // NOT opted-in
@@ -79,7 +78,7 @@ describe("Database Down Notification", () => {
assert.ok(Notification.cacheLastRefresh > 0, "Cache refresh time should be set");
// Verify test notification (opt-in) is in cache
- const cached = Notification.notificationCache.find(n => n.id === testNotification.id);
+ const cached = Notification.notificationCache.find((n) => n.id === testNotification.id);
assert.ok(cached, "Opt-in notification should be in cache");
assert.strictEqual(cached.name, "Test Notification");
// Config is stored as raw string, parse to verify
@@ -87,7 +86,7 @@ describe("Database Down Notification", () => {
assert.strictEqual(config.type, "webhook");
// Verify non-opt-in notification is NOT in cache
- const nonOptInCached = Notification.notificationCache.find(n => n.id === nonOptInBean.id);
+ const nonOptInCached = Notification.notificationCache.find((n) => n.id === nonOptInBean.id);
assert.strictEqual(nonOptInCached, undefined, "Non-opt-in notification should NOT be in cache");
} finally {
// Clean up