From 49d09dfd16a6f2f67db71109e3f4c249f569dc12 Mon Sep 17 00:00:00 2001 From: Saurabh Kumar Bajpai Date: Wed, 5 Aug 2026 18:51:23 +0530 Subject: [PATCH] fix: resolve 4 bugs in devtrack --- e2e/auth.spec.ts | 3 ++- 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 ++ 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/e2e/auth.spec.ts b/e2e/auth.spec.ts index c2bcfb4cf..aa3b9390a 100644 --- a/e2e/auth.spec.ts +++ b/e2e/auth.spec.ts @@ -74,4 +74,5 @@ test("[Auth E2E] landing page shows DevTrack feature section", async ({ // Features section or a recognised feature keyword must be present. const features = page.locator("#features"); await expect(features).toBeVisible(); -}); \ No newline at end of file +}); +.catch(err => console.error("Promise.all failed:", err)); \ No newline at end of file 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