Skip to content

1.x: UnicastSubject does not replay onNext calls made prior to subscription if onError is also called prior to subscription. #5165

@dano

Description

@dano

I'm using RxJava 1.2.5. Consider this code:

    UnicastSubject<String> s = UnicastSubject.create();
    s.onNext("1");
    s.onNext("2");
    s.onError(new Exception("uh oh"));
    s.subscribe(System.out::println, System.out::println);

This outputs:
java.lang.Exception: uh oh

However, the same code using RxJava 2.0.7 version of UnicastSubject outputs:
1
2
java.lang.Exception: uh oh

Which is the behavior I expected from 1.x.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions