From 3445e504a21e87bad68c51e51ac0a8bbe4296fc6 Mon Sep 17 00:00:00 2001 From: Ulas Kalayci Date: Mon, 20 Apr 2026 23:46:06 +0200 Subject: [PATCH] fix(ics): add color to ON CONFLICT DO UPDATE and per-iteration try/catch in sync loop --- server/services/ics-subscription.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/server/services/ics-subscription.js b/server/services/ics-subscription.js index 595a51b..e670977 100644 --- a/server/services/ics-subscription.js +++ b/server/services/ics-subscription.js @@ -133,7 +133,8 @@ async function syncOne(sub) { start_datetime = excluded.start_datetime, end_datetime = excluded.end_datetime, all_day = excluded.all_day, - location = excluded.location + location = excluded.location, + color = excluded.color WHERE user_modified = 0 `); @@ -164,7 +165,10 @@ async function sync(subscriptionId) { const subs = subscriptionId ? db.get().prepare('SELECT * FROM ics_subscriptions WHERE id = ?').all(subscriptionId) : db.get().prepare('SELECT * FROM ics_subscriptions').all(); - for (const sub of subs) await syncOne(sub); + for (const sub of subs) { + try { await syncOne(sub); } + catch (err) { log.error(`Sync Abonnement ${sub.id} fehlgeschlagen: ${err.message}`); } + } } function getAll(userId) {