Skip to content

[4.0.5.1 backport] CBG-5551: Revert "CBG-5262 fix missing changes with active_only=true and limit="#8419

Merged
adamcfraser merged 1 commit into
release/4.0.5.1from
CBG-5551
Jul 6, 2026
Merged

[4.0.5.1 backport] CBG-5551: Revert "CBG-5262 fix missing changes with active_only=true and limit="#8419
adamcfraser merged 1 commit into
release/4.0.5.1from
CBG-5551

Conversation

@torcolvin

Copy link
Copy Markdown
Collaborator

[4.0.5.1 backport] CBG-5551: Revert "CBG-5262 fix missing changes with active_only=true and limit= (#8416)

Cherry-pick of 7a6a76f

…h active_only=true and limit= (#8416)

Cherry-pick of 7a6a76f
Copilot AI review requested due to automatic review settings July 6, 2026 01:57

Copilot AI left a comment

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.

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 in singleChannelCacheImpl.GetChanges.
  • Deletes channel-cache tests that previously exercised active_only + limit scenarios.

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 thread db/channel_cache_test.go
Comment on lines 598 to 600
assert.Equal(t, "CleanAgedItems", backgroundTaskError.TaskName)
assert.Equal(t, options.ChannelCacheAge, backgroundTaskError.Interval)
}
@adamcfraser adamcfraser merged commit 02f1dd4 into release/4.0.5.1 Jul 6, 2026
53 of 54 checks passed
@adamcfraser adamcfraser deleted the CBG-5551 branch July 6, 2026 02:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants