Skip to content

CBG-5548: Revert "CBG-5262 fix missing changes with active_only=true and limit=#8416

Merged
adamcfraser merged 1 commit into
mainfrom
CBG-5548
Jul 5, 2026
Merged

CBG-5548: Revert "CBG-5262 fix missing changes with active_only=true and limit=#8416
adamcfraser merged 1 commit into
mainfrom
CBG-5548

Conversation

@torcolvin

Copy link
Copy Markdown
Collaborator

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.

…and limit= (#8144)"

This reverts commit 2e3efd6 due to a regression in activeOnly when hitting pagination limit.

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

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.GetChanges behavior 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.go that 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 {

@adamcfraser adamcfraser left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@adamcfraser adamcfraser merged commit 7a6a76f into main Jul 5, 2026
49 checks passed
@adamcfraser adamcfraser deleted the CBG-5548 branch July 5, 2026 22:49
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