From 8402adbd456df08ddbc28c4818c1fcc9c5b0214a Mon Sep 17 00:00:00 2001 From: mARTin Date: Mon, 23 Mar 2026 01:35:56 +0100 Subject: [PATCH] fix: always full-fetch Google Tasks for linked someday lists The updatedMin optimization skipped tasks that were missed during initial sync. Now does a full fetch when a someday list is linked, ensuring all remote tasks are discovered. v1.57.13 Co-Authored-By: Claude Opus 4.6 --- package.json | 2 +- src/app/api/tasks/sync/route.ts | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 02a9dc3..591869c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "my-weekly-todo-list", - "version": "1.57.12", + "version": "1.57.13", "description": "A web-based weekly task management application that organizes to-dos and calendar events in a single, intuitive weekly view", "main": "index.js", "scripts": { diff --git a/src/app/api/tasks/sync/route.ts b/src/app/api/tasks/sync/route.ts index 396782a..b3788fe 100644 --- a/src/app/api/tasks/sync/route.ts +++ b/src/app/api/tasks/sync/route.ts @@ -86,14 +86,16 @@ export async function GET(req: NextRequest) { for (const listId of googleListIds) { const localTasks = googleByList.get(listId) || []; try { - // Use updatedMin to only fetch tasks changed since last sync + // Use updatedMin only when there's no linked someday list + // (i.e. only updating existing tasks). When a list is linked, + // always do a full fetch to discover any missing tasks. let updatedMin: string | undefined; - if (localTasks.length > 0) { + const hasSomedayList = listIdToSomedayList.has(listId); + if (localTasks.length > 0 && !hasSomedayList) { const maxSyncDate = localTasks.reduce((max, t) => { const d = t.lastSyncedAt || t.updatedAt; return d > max ? d : max; }, new Date(0)); - // Subtract 1 minute buffer to avoid missing edge cases updatedMin = new Date(maxSyncDate.getTime() - 60000).toISOString(); } const remoteTasks = await fetchGoogleTasksForSync(client, listId, updatedMin);