From 5193c7addc465d30e15a9ff335c985b9704de62d Mon Sep 17 00:00:00 2001 From: Scott McCarty Date: Fri, 6 Feb 2026 16:40:29 -0500 Subject: [PATCH] Treat 404 on delete as success in sync When deleting a pomodoro that was never synced to Google Sheets, the DELETE API returns 404. This should be treated as success since the record doesn't exist anyway. Co-Authored-By: Claude Opus 4.5 --- static/js/storage.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/static/js/storage.js b/static/js/storage.js index 3b46eb0..8138435 100644 --- a/static/js/storage.js +++ b/static/js/storage.js @@ -467,7 +467,8 @@ const res = await authenticatedFetch(`/api/sheets/pomodoros/${record_id}`, { method: 'DELETE' }); - if (!res.ok) throw new Error(`HTTP ${res.status}`); + // 404 on delete is OK - record already doesn't exist + if (!res.ok && res.status !== 404) throw new Error(`HTTP ${res.status}`); } } else if (store === 'settings') { const res = await authenticatedFetch('/api/sheets/settings', {