fix: maintainer queue pagination with in-SQL filters and exact counts - #868
Open
ionfwsrijan wants to merge 1 commit into
Open
fix: maintainer queue pagination with in-SQL filters and exact counts#868ionfwsrijan wants to merge 1 commit into
ionfwsrijan wants to merge 1 commit into
Conversation
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. |
|
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. |
Contributor
Author
|
@Soumya-codr @codersogs-code Please review this |
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix: Maintainer Queue Pagination with In-SQL Filters and Exact Counts (#863)
Problem
getMaintainerPrQueueapplied 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.getMaintainerIssueQueuewindowed the DB read with.range()before bucket classification (which happens in-app), making matching rows past the window unreachable. BothhasMoreflags were guessed from a full window.Changes
src/app/actions/maintainer/queue.tsgetMaintainerPrQueue: author-level filters are pushed into SQL via aprofilespre-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' }andhasMore = startIdx + PAGE_SIZE < total, so pagination windows only contain rows the maintainer wants andhasMoreis 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;hasMorederives from the exact in-memory length.src/app/actions/maintainer/queue.test.tscovering exact counts, SQL author filters, and null-author handling at level 0;maintainer.test.tsupdated 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