Skip to content

Name of method ignoreErrors break contract of PublishSubject #217

@ajjnix

Description

@ajjnix

PublishSubject is not working with ignoreErrors function because ignoreErrors is synonym of retry. But PublishSubject can't retry by contract cause it's not operation.

        let subject = PublishSubject<Int>()
        _ = subject.ignoreErrors().subscribe(onNext: {
            print($0)
        })
        subject.onNext(1)
        subject.onError(RxError.unknown)
        subject.onNext(2)
        subject.onNext(3)

// output: INFINIRY_LOOP

In this code I can think the sequence can't terminated on error (and yes it's not terminated 😺) but it's not right by contract of Observable. So I think this operator is mislead and I suggest to remove it.

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