From 027139f13382dc2324649fb49c059b016695e8ee Mon Sep 17 00:00:00 2001 From: Nexus0ps Date: Tue, 2 Jun 2026 13:40:42 -0400 Subject: [PATCH] fix(feed): use parsePageParam to clamp invalid lounge page values Replaces raw `Number(resolvedParams.page) || 1` with the shared parsePageParam helper so negative, non-finite, and huge page values normalize correctly before the Supabase .range() offset is built. Matches the pagination-hardening pattern used on other listing pages. Fixes #358 --- src/app/feed/page.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/feed/page.tsx b/src/app/feed/page.tsx index 7dc2735f..a1c21bf2 100644 --- a/src/app/feed/page.tsx +++ b/src/app/feed/page.tsx @@ -1,3 +1,4 @@ +import { parsePageParam } from "@/lib/pagination"; /* eslint-disable react-hooks/purity */ import { Suspense } from "react"; import { createClient } from "@/lib/supabase/server"; @@ -24,7 +25,7 @@ async function FeedContent({ searchParams }: FeedPageProps) { const resolvedParams = await searchParams; const sort = resolvedParams.sort || "hot"; const tag = resolvedParams.tag || undefined; - const page = Number(resolvedParams.page) || 1; + const page = parsePageParam(resolvedParams.page); const supabase = await createClient();