fix(supergroups): Fallback to limited query on large supergroups#113573
Merged
fix(supergroups): Fallback to limited query on large supergroups#113573
Conversation
The drawer was stuffing every supergroup member ID into the stream-match URL as `issue.id:[…]`. For a 7k-member group that blew past GET size limits, and paginating through the full member list meant hundreds of chunked requests. Cap the page fetch at the visible page and branch the hoist by size: - <= 200 members: inline `issue.id:[…]` like before, server returns up to 25 matches, we sort those to the front. - > 200 members: run the stream query unfiltered with per_page 100 and intersect locally with the member set. So the stream's own top results that happen to be members still get hoisted onto page 1. Also memoize the 7k-element sort so it doesn't rerun every render, add a `SupergroupDetailFixture`, and a drawer spec covering the large-group hoist path. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Collapses HOIST_INLINE_ID_LIMIT (200) and HOIST_STREAM_SCAN_SIZE (100) into a single HOIST_LIMIT = 100. Inline-id path still uses `issue.id:[…]` but now matches its per_page to the scan path, so a 100 member supergroup with 40 hits gets all 40 hoisted instead of the old 25 cap. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
cvxluo
approved these changes
Apr 21, 2026
| * scan window (top stream results we inspect when the id list is too big to | ||
| * inline). | ||
| */ | ||
| const HOIST_LIMIT = 100; |
Contributor
There was a problem hiding this comment.
testing this on some very big supergroups, we might want to do 50 instead? i don't think users will paginate that much, and once you get to the second page the accuracy of showing whether a row is hoisted is much less important
Drop HOIST_LIMIT from 100 to 50. Users rarely paginate past the first page, and once they do, showing whether a row is hoisted matters less. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.
Disable matching group hoisting for large super groups.
<= 50members: stream match usesissue.id:[…]and returns up to 100 hits, sorted to the front of the list.> 50members: stream query runs unfiltered withper_page=100. Stream results land on page 1.Each page fetch asks for at most 25 IDs so URL size stays bounded regardless of supergroup size.
Memoizes the member-list sort. Adds a
SupergroupDetailFixtureand a drawer spec for the large-group path.