Skip to content

Operators do not honour the Rx observable contract for terminal events #1142

Description

@dwcullop

Switch turned out to be dropping OnCompleted and mishandling OnError (#1136, #1138). That raised an obvious question: how many other operators do the same thing?

I wrote a harness that drives every operator overload with a source that completes or errors, and records what the operator actually emits. It covered 476 of the 499 extension methods that take an IObservable. The remainder do not return an observable, so there is nothing to assert.

106 overloads across 33 operator names either never deliver OnCompleted, or get the error path wrong by throwing out of Subscribe, converting the error to a completion, or dropping it entirely.

The findings are split by collection type in the two child issues. Several of the entries are the same bug reached by different names, so both lists are grouped by the implementation the overloads share rather than by public API name.

Worth noting for anyone picking this up: overloads of the same operator often do not share behaviour. Sort(comparer) completes correctly while Sort(observableComparer) and Sort(comparer, resorter) do not. Fixes need checking against every overload, not one representative.

The Switch entries in both lists are already handled by #1137 and #1139 and are only there for completeness.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions