Skip to content

fix(comments): validate pagination params#131

Merged
ralyodio merged 1 commit into
profullstack:masterfrom
rissrice2105-agent:fix/comments-pagination-params
Jul 17, 2026
Merged

fix(comments): validate pagination params#131
ralyodio merged 1 commit into
profullstack:masterfrom
rissrice2105-agent:fix/comments-pagination-params

Conversation

@rissrice2105-agent

Copy link
Copy Markdown
Contributor

Description

Validate torrent comment pagination with the repository's strict integer parser. Malformed, negative, fractional, oversized, and partial values now fall back to safe defaults instead of reaching the database query.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

TDD Checklist

  • Tests written FIRST (before implementation)
  • All new code has corresponding tests
  • All tests pass locally (pnpm test) — 2,335 pass; 6 unrelated Windows/stale baseline failures
  • Edge cases are covered
  • No any types used
  • TypeScript strict mode passes — local install is blocked by the minimum-release-age policy for today's @profullstack/stack@0.1.3
  • ESLint passes

Security Checklist

  • No Supabase calls from client-side code
  • No sensitive data exposed in client bundle
  • Input validation implemented
  • Rate limiting considered (not applicable to this read-only pagination change)

Testing

Test Coverage

  • Number of new tests: 1
  • Test file modified: src/app/api/torrents/[id]/comments/route.test.ts

Results

  • Focused route tests: 10/10 passed
  • Full suite: 2,335 passed, 7 skipped; 6 unrelated baseline failures
  • ESLint: 0 errors
  • git diff --check: passed

Additional Notes

The full-suite failures are unrelated to this change: Unix-only sleep/path assertions on Windows and a stale torlnk package expectation. No invoice will be sent until the PR is merged and accepted.

@ralyodio
ralyodio merged commit 2bf2df3 into profullstack:master Jul 17, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants