From beb3281194fe73f826365745a7eae0d0b47936a2 Mon Sep 17 00:00:00 2001 From: mARTin Date: Mon, 2 Mar 2026 08:26:14 +0100 Subject: [PATCH] fix(v1.10.1): force dynamic for problematic APIs and improve Outlook sync logs --- package.json | 2 +- src/app/api/calendar/outlook/callback/route.ts | 2 ++ src/app/api/calendar/outlook/start/route.ts | 2 ++ src/app/api/goal/route.ts | 2 ++ src/app/api/tasks/lists/route.ts | 2 ++ src/lib/outlook-calendar.ts | 4 +++- 6 files changed, 12 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 47424d1..c88bd61 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "my-weekly-todo-list", - "version": "1.10.0", + "version": "1.10.1", "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/calendar/outlook/callback/route.ts b/src/app/api/calendar/outlook/callback/route.ts index b519c2f..22c7fdc 100644 --- a/src/app/api/calendar/outlook/callback/route.ts +++ b/src/app/api/calendar/outlook/callback/route.ts @@ -4,6 +4,8 @@ import { authOptions } from "@/lib/auth"; import { prisma } from '@/lib/prisma'; import { getTokens, getUserCalendars } from '@/lib/outlook-calendar'; +export const dynamic = 'force-dynamic'; + export async function GET(request: NextRequest) { const baseUrl = process.env.NEXTAUTH_URL || request.url; diff --git a/src/app/api/calendar/outlook/start/route.ts b/src/app/api/calendar/outlook/start/route.ts index b90e54c..288bf33 100644 --- a/src/app/api/calendar/outlook/start/route.ts +++ b/src/app/api/calendar/outlook/start/route.ts @@ -3,6 +3,8 @@ import { getServerSession } from 'next-auth'; import { authOptions } from "@/lib/auth"; import { getAuthUrl } from '@/lib/outlook-calendar'; +export const dynamic = 'force-dynamic'; + export async function GET(request: NextRequest) { try { const session = await getServerSession(authOptions); diff --git a/src/app/api/goal/route.ts b/src/app/api/goal/route.ts index cb09f41..bf48682 100644 --- a/src/app/api/goal/route.ts +++ b/src/app/api/goal/route.ts @@ -4,6 +4,8 @@ import { authOptions } from '@/lib/auth'; import { prisma } from '@/lib/prisma'; import { getHolidayHint } from '@/lib/holidays'; +export const dynamic = 'force-dynamic'; + export async function GET(req: Request) { try { const session = await getServerSession(authOptions); diff --git a/src/app/api/tasks/lists/route.ts b/src/app/api/tasks/lists/route.ts index 9f9d9e3..5aa63a1 100644 --- a/src/app/api/tasks/lists/route.ts +++ b/src/app/api/tasks/lists/route.ts @@ -6,6 +6,8 @@ import { createGoogleClient, fetchGoogleTaskLists } from '@/lib/google-tasks'; import { fetchMsTodoLists } from '@/lib/microsoft-todo'; import { getOutlookAccessToken } from '@/lib/outlook-token'; +export const dynamic = 'force-dynamic'; + const prisma = new PrismaClient(); export async function GET(req: NextRequest) { diff --git a/src/lib/outlook-calendar.ts b/src/lib/outlook-calendar.ts index 1b147d7..982a49d 100644 --- a/src/lib/outlook-calendar.ts +++ b/src/lib/outlook-calendar.ts @@ -163,7 +163,9 @@ export const getUpcomingEvents = async ( ); if (!response.ok) { - throw new Error(`Failed to fetch events: ${response.statusText}`); + const errorText = await response.text(); + console.error(`[OUTLOOK] Failed to fetch events for calendar ${calendarId}:`, response.status, response.statusText, errorText); + throw new Error(`Failed to fetch events: ${response.status} ${response.statusText}`); } const data = await response.json();