-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
fix(aci): update hits count for workflow fire history #103400
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
src/sentry/api/paginator.py
Outdated
| if known_hits is not None: | ||
| hits = known_hits | ||
| elif count_hits: | ||
| hits = self.count_hits(max_hits=MAX_HITS_LIMIT) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it doesn't seem like we're using the max_hits variable from the method signature, should that be used here if set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good callout, updated in 3da9532
| ) | ||
|
|
||
| # Count distinct groups for pagination | ||
| group_count = qs.count() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a quick note that this will add another query and may impact performance; i'm guessing we need this to get the total number of results compared to the paginated list though.
| elif count_hits: | ||
| if max_hits is None: | ||
| max_hits = MAX_HITS_LIMIT | ||
| hits = self.count_hits(max_hits) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Inconsistent Paginator Hit Counts
When known_hits is provided, it should be capped by max_hits for consistency with SequencePaginator. Currently, OffsetPaginator uses known_hits directly without applying the max_hits bound. If both parameters are provided together, hits could exceed max_hits, creating inconsistent behavior across paginators.
fixes a bug where
X-Hitswas turning the total sum of alerts (right column), rather than the total number of groups (rows in the table)