Skip to content

fix: maintainer queue pagination with in-SQL filters and exact counts - #868

Open
ionfwsrijan wants to merge 1 commit into
Coder-s-OG-s:mainfrom
ionfwsrijan:fix/issue-863-queue-pagination-filters
Open

fix: maintainer queue pagination with in-SQL filters and exact counts#868
ionfwsrijan wants to merge 1 commit into
Coder-s-OG-s:mainfrom
ionfwsrijan:fix/issue-863-queue-pagination-filters

Conversation

@ionfwsrijan

Copy link
Copy Markdown
Contributor

Fix: Maintainer Queue Pagination with In-SQL Filters and Exact Counts (#863)

Problem

getMaintainerPrQueue applied author-level and AI-flag filters in-app after pulling a 100-row DB window, so the offset math produced empty pages and hid rows beyond offset 100. getMaintainerIssueQueue windowed the DB read with .range() before bucket classification (which happens in-app), making matching rows past the window unreachable. Both hasMore flags were guessed from a full window.

Changes

  • src/app/actions/maintainer/queue.ts
    • getMaintainerPrQueue: author-level filters are pushed into SQL via a profiles pre-query (level >= minContributorLevel, level IN authorLevel) joined through .or('author_user_id.in.(...),author_user_id.is.null'); the in-app post-join filtering is removed. The query now uses { count: 'exact' } and hasMore = startIdx + PAGE_SIZE < total, so pagination windows only contain rows the maintainer wants and hasMore is exact.
    • getMaintainerIssueQueue: removed the DB .range() window — the full candidate set (bounded by the maintainer's own repos) is read, classified in-app, and sliced with a plain page offset; hasMore derives from the exact in-memory length.
  • Tests: new src/app/actions/maintainer/queue.test.ts covering exact counts, SQL author filters, and null-author handling at level 0; maintainer.test.ts updated for the in-SQL filter behavior.

Impact

Every page of the maintainer issue/PR queue is correct — no empty pages, no hidden rows past offset 100, and reliable hasMore.

Closes #863

@vercel

vercel Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

@ionfwsrijan is attempting to deploy a commit to the codersogs-3057's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown

Hey @ionfwsrijan

You have 5 open PRs right now. The limit is 3 at a time.

Please get your existing PRs merged or closed before opening new ones:

This PR will remain open but won't be reviewed until you're under the limit. See our Contributing Guidelines for details.

@ionfwsrijan

Copy link
Copy Markdown
Contributor Author

@Soumya-codr @codersogs-code Please review this

@ionfwsrijan

Copy link
Copy Markdown
Contributor Author

@jakharmonika364

@Ayush4958 Ayush4958 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM !!!

@ionfwsrijan

Copy link
Copy Markdown
Contributor Author

@Ayush4958 Can we merge this then?

@Ayush4958

Ayush4958 commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator

@Ayush4958 Can we merge this then?

I am reviewer so I had to review the pr from my end
I don't have merge access, I have reviewer access
Maintainer will review this PR from their end also

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.

[BUG] Maintainer PR/Issue Queue Pagination Is Broken by In-App Filtering: Empty Pages, Wrong hasMore, and Unreachable Rows

2 participants