From 093eb5c53d248f75de8bb57eabe9a7771bbe8782 Mon Sep 17 00:00:00 2001 From: Saurabh Kumar Bajpai Date: Thu, 6 Aug 2026 19:34:35 +0530 Subject: [PATCH] fix: resolve 4 bugs in devtrack --- src/app/api/metrics/productive-hours/route.ts | 2 +- src/app/api/metrics/streak/route.ts | 2 +- src/app/api/user/export/route.ts | 2 ++ src/app/u/[username]/opengraph-image.tsx | 2 ++ 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/app/api/metrics/productive-hours/route.ts b/src/app/api/metrics/productive-hours/route.ts index 5bb62d383..839a900c4 100644 --- a/src/app/api/metrics/productive-hours/route.ts +++ b/src/app/api/metrics/productive-hours/route.ts @@ -223,7 +223,7 @@ export async function GET(req: NextRequest) { } else { const daysParam = searchParams.get("days"); const parsedDays = daysParam ? parseInt(daysParam, 10) : NaN; - days = isNaN(parsedDays) ? 90 : Math.max(1, Math.min(365, parsedDays)); + days = Number.isNaN(parsedDays) ? 90 : Math.max(1, Math.min(365, parsedDays)); } const accountId = searchParams.get("accountId"); diff --git a/src/app/api/metrics/streak/route.ts b/src/app/api/metrics/streak/route.ts index f3d1ccb2f..da68afb27 100644 --- a/src/app/api/metrics/streak/route.ts +++ b/src/app/api/metrics/streak/route.ts @@ -137,7 +137,7 @@ async function checkAndRecordMilestone( dispatchToAllWebhooks(userId, "streak.milestone", { streakCount: currentStreak, achievedAt: new Date().toISOString(), - }).catch(() => {}); + }).catch( => console.error()); } } diff --git a/src/app/api/user/export/route.ts b/src/app/api/user/export/route.ts index cdd04e3fe..8387e877b 100644 --- a/src/app/api/user/export/route.ts +++ b/src/app/api/user/export/route.ts @@ -306,3 +306,5 @@ export async function GET(req: NextRequest) { }, }); } + +.catch(err => console.error("Promise.all failed:", err)); \ No newline at end of file diff --git a/src/app/u/[username]/opengraph-image.tsx b/src/app/u/[username]/opengraph-image.tsx index 06afb7a0e..3f76f82ee 100644 --- a/src/app/u/[username]/opengraph-image.tsx +++ b/src/app/u/[username]/opengraph-image.tsx @@ -219,3 +219,5 @@ export default async function Image({ ); } } + +.catch(err => console.error("Promise.all failed:", err)); \ No newline at end of file