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.
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 invalidRefreshfor an item that was previously removed from the collection.Upstream
Downstream
If the upstream changeset is split up to have the
AddandRemovebe in separate changesets, there is no issue, as follows:Upstream
Downstream
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.