Skip to content

Clamp invalid lounge feed page values before Supabase range queries #358

@Zekbot001

Description

@Zekbot001

Bug

The server-rendered lounge page parses page with Number(resolvedParams.page) || 1 before calculating a Supabase range.

Examples:

  • /feed?page=-5 produces a negative range offset.
  • /feed?page=Infinity produces a non-finite range offset.
  • Very large numeric pages produce extreme offsets.

The API feed route and the public listing pages already use bounded pagination parsing, but the lounge page still bypasses the shared page parser.

Expected

Use the existing parsePageParam helper so low or non-finite values normalize to page 1, fractional values truncate consistently, and huge values cap at the helper's maximum before Supabase .range(...) is built.

Proposed fix

Wire src/app/feed/page.tsx through parsePageParam and add explicit non-finite regression coverage to the helper test.

Paid task context: https://ugig.net/gigs/abd6b2a0-e728-48cf-a46f-f99e419ed94e

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions