Skip to content

[Bug]: AutoRefreshOnObservable produces refreshes for immediately-removed items #1099

@JakenVeina

Description

@JakenVeina

Feeding the following sequence of changesets into .AutoRefreshOnObservable() (for the cache version, the list version doesn't seem to have this issue, it just emits an empty changeset), when the refresh observable emits a value immediately upon subscription, results in the following downstream sequence changesets, which includes an invalid Refresh for an item that was previously removed from the collection.

Upstream

2 Changes
    Add #1
    Remove #1

Downstream

2 Changes
    Add #1
    Remove #1
1 Change
    Refresh #1

If the upstream changeset is split up to have the Add and Remove be in separate changesets, there is no issue, as follows:

Upstream

1 Change
    Add #1
1 Change
    Remove #1

Downstream

1 Change
    Add #1
1 Change
    Refresh #1
1 Change
    Remove #1

This doesn't seem to be an issue with any of the operators used internally within AutoRefreshOnObservable() (E.G. .MergeMany() and .SubscribeMany()), but with the sequencing of subscriptions within .AutoRefresh() itself.

I discovered this while expanding our testing suite for .FilterOnObservable(), which ends up occasionally including items in its downstream that were removed upstream.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions