CBG-5548: Revert "CBG-5262 fix missing changes with active_only=true and limit=#8416
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Reverts the prior change to channel-cache change retrieval introduced in CBG-5262, due to a reported regression when active_only=true interacts with internal pagination limits (page-sized Limit).
Changes:
- Reverts
singleChannelCacheImpl.GetChangesbehavior to stop pulling additional cache entries when the query already filled the page, and to always apply the remaining-room limit when appending cache results. - Removes unit tests in
db/channel_cache_test.gothat were added to validate the reverted behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| db/channel_cache_test.go | Removes tests that asserted the (now-reverted) active_only + limit behavior. |
| db/channel_cache_single.go | Reverts cache/query merge logic in GetChanges to avoid over-returning results when ActiveOnly and a page limit is hit. |
Comment on lines
441
to
445
| result := resultFromQuery | ||
| room := options.Limit - len(result) | ||
| if (options.Limit == 0 || room > 0 || options.ActiveOnly) && len(resultFromCache) > 0 { | ||
| if (options.Limit == 0 || room > 0) && len(resultFromCache) > 0 { | ||
| // Concatenate the view & cache results: | ||
| if len(result) > 0 && resultFromCache[0].Sequence == result[len(result)-1].Sequence { |
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.
CBG-5548: Revert "CBG-5262 fix missing changes with active_only=true and limit= (#8144)"
This reverts commit 2e3efd6 due to a regression in activeOnly when hitting pagination limit.