Skip to content

fix: add pagination limits to unbounded findMany queries (#127)#203

Merged
kilodesodiq-arch merged 1 commit into
ChainForgee:mainfrom
Alqku:fix/issue-127-pagination-limits
Jun 29, 2026
Merged

fix: add pagination limits to unbounded findMany queries (#127)#203
kilodesodiq-arch merged 1 commit into
ChainForgee:mainfrom
Alqku:fix/issue-127-pagination-limits

Conversation

@Alqku

@Alqku Alqku commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Prisma findMany calls in ClaimsService.findAll() and CampaignsService.findAll() had no take limit, risking memory exhaustion on large datasets. This PR adds default pagination (50 records/page, max 200) with skip/take to both methods.

Changes

  • claims.service.ts: findAll(page=1, limit=50) — enforces take up to 200, adds skip, adds orderBy
  • campaigns.service.ts: findAll(..., page=1, limit=50) — same pagination pattern

Testing

Existing unit tests pass. Default args preserve backward compatibility with callers that pass no pagination params.

Closes #127

@kilodesodiq-arch kilodesodiq-arch left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kilodesodiq-arch kilodesodiq-arch merged commit 91cb30a into ChainForgee:main Jun 29, 2026
1 check 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.

[MEDIUM] Prisma queries lack pagination limits — potential unbounded result sets

2 participants