fix(supergroups): Hoist stream issues to the first page of the drawer#113192
Merged
fix(supergroups): Hoist stream issues to the first page of the drawer#113192
Conversation
…e drawer The supergroup drawer paginates `group_ids` in page-size chunks, then filters each page against the current stream query. If the matched issues sit past the first page in the underlying list, they never show up when you open the drawer — which is the whole point of opening it. Run the stream-query match over the full `group_ids` list up front, sort matched issues first, then paginate. The per-page sort is gone since the order is already right, and the page index gets clamped in case the list shrinks. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
cvxluo
approved these changes
Apr 16, 2026
| group: pageGroupIds.map(String), | ||
| project: ALL_ACCESS_PROJECTS, | ||
| }, | ||
| staleTime: 30_000, |
Contributor
There was a problem hiding this comment.
Bug: The query for matched issues is limited by per_page: PAGE_SIZE, so if more than 25 issues match, only the first 25 are hoisted to the top.
Severity: MEDIUM
Suggested Fix
Remove the per_page: PAGE_SIZE parameter from the API query that fetches the matchedIds. This will ensure that all matching issue IDs from the full groupIds list are retrieved, allowing the sorting logic to correctly hoist all matched issues to the beginning of the list before pagination is applied.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location: static/app/views/issueList/supergroups/supergroupDrawer.tsx#L168
Potential issue: The logic to hoist issues matching a stream query is incomplete. The
API call to find these matched issues is limited by `per_page: PAGE_SIZE`, which is 25.
If more than 25 issues match the query across all `groupIds`, only the first 25 are
identified and hoisted to the top of the list. Any matched issues beyond this initial
set will not be sorted to the top and will remain scattered across subsequent pages.
This contradicts the intended behavior of sorting all matched issues first before
applying pagination.
Did we get this right? 👍 / 👎 to inform future reviews.
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.
Make sure issues that match the current stream query land on page 1 of the supergroup drawer, instead of being sorted only within whatever page they happened to fall on.