From bdeb5bbc32995670a1c27191366918a2c83a9d30 Mon Sep 17 00:00:00 2001 From: Chris Date: Tue, 24 Mar 2026 14:30:31 +0200 Subject: [PATCH] Fix Telegram notification spam by marking JSON field as changed (#969) Fixes issue where Sequelize wasn't detecting changes to the channel_sent_at JSON field, causing markChannelAsSent() to not persist updates to the database. This caused the same notification to be sent via Telegram every 15 minutes (on each scheduler run) because the rate limiting timestamp was never saved. The fix adds this.changed('channel_sent_at', true) before save() to explicitly mark the field as modified, which is required for Sequelize to detect changes to JSON fields. Impact: Reduces duplicate Telegram notifications from every 15min to at most once per 24 hours per task. --- backend/models/notification.js | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/models/notification.js b/backend/models/notification.js index 5888dfc..253aa40 100644 --- a/backend/models/notification.js +++ b/backend/models/notification.js @@ -309,6 +309,7 @@ module.exports = (sequelize) => { const sentTimes = this.channel_sent_at || {}; sentTimes[channel] = new Date().toISOString(); this.channel_sent_at = sentTimes; + this.changed('channel_sent_at', true); await this.save(); return this; };