Skip to content

fix(supergroups): Fallback to limited query on large supergroups#113573

Merged
scttcper merged 5 commits intomasterfrom
scttcper/supergroup-hoist
Apr 22, 2026
Merged

fix(supergroups): Fallback to limited query on large supergroups#113573
scttcper merged 5 commits intomasterfrom
scttcper/supergroup-hoist

Conversation

@scttcper
Copy link
Copy Markdown
Member

@scttcper scttcper commented Apr 21, 2026

Disable matching group hoisting for large super groups.

  • <= 50 members: stream match uses issue.id:[…] and returns up to 100 hits, sorted to the front of the list.
  • > 50 members: stream query runs unfiltered with per_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 SupergroupDetailFixture and a drawer spec for the large-group path.

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>
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Apr 21, 2026
@scttcper scttcper changed the title fix(supergroups): Cap drawer URL and hoist stream matches safely fix(supergroups): Fallback to limited query on large supergroups Apr 21, 2026
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>
@scttcper scttcper marked this pull request as ready for review April 21, 2026 23:06
@scttcper scttcper requested a review from a team as a code owner April 21, 2026 23:06
* scan window (top stream results we inspect when the id list is too big to
* inline).
*/
const HOIST_LIMIT = 100;
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.

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>
@scttcper scttcper merged commit 0211f19 into master Apr 22, 2026
62 checks passed
@scttcper scttcper deleted the scttcper/supergroup-hoist branch April 22, 2026 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants