Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions e2e/dashboard-widgets.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,14 +229,14 @@ test("dashboard widgets render with mocked metrics", async ({ page }) => {
await expect(
page.getByRole("heading", { name: "Dashboard", exact: true })
).toBeVisible({ timeout: 30000 });
await expect(page.getByRole("heading", { name: "Your Commits" })).toBeVisible(
await expect(page.getByRole("heading", { name: "Your Commits" }).first()).toBeVisible(
{ timeout: 10000 }
);
await expect(page.getByRole("heading", { name: "PR Analytics" }).first()).toBeVisible(
{ timeout: 10000 }
);
await expect(
page.getByRole("heading", { name: "Goals", exact: true })
page.getByRole("heading", { name: "Goals", exact: true }).first()
).toBeVisible({ timeout: 10000 });
await expect(page.getByText("Make 10 commits")).toBeVisible({
timeout: 10000,
Expand Down
2 changes: 1 addition & 1 deletion e2e/notifications.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ test("notification bell opens and closes drawer", async ({ page }) => {
await expect(page.getByRole("heading", { name: "Dashboard", exact: true })).toBeVisible({ timeout: 30000 });

// Find and click the notification bell
const bellButton = page.getByRole("button", { name: /Notifications/ });
const bellButton = page.getByRole("button", { name: /Notifications/ }).first();
await expect(bellButton).toBeVisible({ timeout: 10000 });

await bellButton.click();
Expand Down
2 changes: 1 addition & 1 deletion src/app/api/metrics/achievement-progress/route.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getServerSession } from "next-auth";
import { getServerSession } from "next-auth";
import { NextRequest } from "next/server";
import { authOptions } from "@/lib/auth";
import { GitHubAuthError, githubAuthErrorResponse } from "@/lib/github-fetch";
Expand Down
3 changes: 2 additions & 1 deletion src/lib/metrics-cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ export const METRICS_CACHE_TTL_SECONDS = {
compare: 30 * 60,
"weekly-summary": 30 * 60,
"commit-times": 30 * 60,
"achievement-progress": 10 * 60,
// 2 hours TTL for historical achievements because they do not require real-time updates
"achievement-progress": 2 * 60 * 60,
} as const;
Comment on lines 20 to 25

type MetricsCacheEndpoint = keyof typeof METRICS_CACHE_TTL_SECONDS;
Expand Down
Loading