Skip to content
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

[Bug]: Sort is preventing empty change notifications despite "suppressEmptyChangeSets: false" on Connect #581

Closed
MagneticLlama opened this issue Apr 28, 2022 · 2 comments · Fixed by #582
Labels

Comments

@MagneticLlama
Copy link

MagneticLlama commented Apr 28, 2022

Describe the bug 🐞

After using Connect with "suppressEmptyChangeSets: false" on an empty SourceCache, Sort will cause the suppression empty of change sets. In the reproduction steps, Subscribe callbacks will not be hit unless Sort is removed.

Step to reproduce

var sourceCache = new SourceCache<Item, int>(p => p.Id);
sourceCache.Connect(suppressEmptyChangeSets: false)
    .Sort(SortExpressionComparer<Item>.Descending(x => x.Id))
    .Bind(out items)
    .Subscribe(x =>
    {
        Console.WriteLine($"Got {items.Count} results");
    });

Expected behavior

Subscribe's onNext and onCompleted should trigger even if the SourceCache is empty when suppressEmptyChangeSets is set to false on Connect.

@RolandPheasant
Copy link
Collaborator

Good spot.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants