From 05259da3617f1cf24065602371bd161dfc39d46a Mon Sep 17 00:00:00 2001 From: Saurabh Kumar Bajpai Date: Thu, 6 Aug 2026 01:23:58 +0530 Subject: [PATCH] fix: resolve 4 bugs in devtrack --- src/app/api/goals/[id]/route.ts | 2 +- src/app/api/metrics/contributions/hourly/route.ts | 2 +- src/app/api/metrics/streak/route.ts | 2 +- src/app/api/user/orgs/route.ts | 2 ++ 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/app/api/goals/[id]/route.ts b/src/app/api/goals/[id]/route.ts index 4a0fdf485..1b4642dc9 100644 --- a/src/app/api/goals/[id]/route.ts +++ b/src/app/api/goals/[id]/route.ts @@ -171,7 +171,7 @@ export async function PATCH( unit: updatedGoal.unit, recurrence: updatedGoal.recurrence, completedAt: new Date().toISOString(), - }).catch(() => {}); + }).catch( => console.error()); } return Response.json({ goal: updatedGoal }); diff --git a/src/app/api/metrics/contributions/hourly/route.ts b/src/app/api/metrics/contributions/hourly/route.ts index 6c8740c62..ffdf11c98 100644 --- a/src/app/api/metrics/contributions/hourly/route.ts +++ b/src/app/api/metrics/contributions/hourly/route.ts @@ -19,7 +19,7 @@ export async function GET(req: NextRequest) { const daysParam = req.nextUrl.searchParams.get("days"); const parsedDays = daysParam ? parseInt(daysParam, 10) : NaN; - const days = isNaN(parsedDays) ? 30 : Math.max(1, Math.min(365, parsedDays)); + const days = Number.isNaN(parsedDays) ? 30 : Math.max(1, Math.min(365, parsedDays)); const bypass = isMetricsCacheBypassed(req); const key = metricsCacheKey( session.githubId ?? session.githubLogin, 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/orgs/route.ts b/src/app/api/user/orgs/route.ts index 5bc5302c2..1444d1258 100644 --- a/src/app/api/user/orgs/route.ts +++ b/src/app/api/user/orgs/route.ts @@ -173,3 +173,5 @@ export async function POST(req: NextRequest) { return NextResponse.json({ error: "Internal server error" }, { status: 500 }); } } + +.catch(err => console.error("Promise.all failed:", err)); \ No newline at end of file