[4.0.5.1 backport] CBG-5551: Revert "CBG-5262 fix missing changes with active_only=true and limit="#8419
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR backports a revert related to active_only=true combined with limit handling in the channel cache changes retrieval logic, intended to address a regression introduced by the earlier “missing changes” fix.
Changes:
- Removes
active_only-specific behavior when merging query (backfill) results with channel-cache results insingleChannelCacheImpl.GetChanges. - Deletes channel-cache tests that previously exercised
active_only+limitscenarios.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| db/channel_cache_single.go | Adjusts how query results are merged with cache results when Limit is reached, removing an ActiveOnly exception. |
| db/channel_cache_test.go | Removes tests covering active_only + limit channel-cache behavior. |
Comment on lines
441
to
451
| 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 { | ||
| resultFromCache = resultFromCache[1:] | ||
| } | ||
| n := len(resultFromCache) | ||
| // Limit evaluation only valid when not activeOnly, since view and cache results don't apply activeOnly filtering | ||
| if !options.ActiveOnly { | ||
| if options.Limit > 0 && room > 0 && room < n { | ||
| n = room | ||
| } | ||
| if options.Limit > 0 && room > 0 && room < n { | ||
| n = room | ||
| } |
Comment on lines
598
to
600
| assert.Equal(t, "CleanAgedItems", backgroundTaskError.TaskName) | ||
| assert.Equal(t, options.ChannelCacheAge, backgroundTaskError.Interval) | ||
| } |
adamcfraser
approved these changes
Jul 6, 2026
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.
[4.0.5.1 backport] CBG-5551: Revert "CBG-5262 fix missing changes with active_only=true and limit= (#8416)
Cherry-pick of 7a6a76f