Skip to content

2.x Time bounded replaySubject getValue() unexpected behavior #5433

@nathankooij

Description

@nathankooij

Affects 2.1.1.

The Javadoc for ReplaySubject::getValue states the following:

Returns a single value the Subject currently has or null if no such value exists.

In combination with a time bounded replay subject I would expect null if either:

  • there has not yet been an emission
  • the emitted item's age is too old

Currently this is not the case as demonstrated by the following test: nathankooij@6afa40c
However, getValues() does return null (that is, old items are evicted), which is also demonstrated by the aforementioned test. To me it seems that either the implementation of getValue/getValues is inconsistent with each other, and the current behavior is not obvious to me from the documentation.

I've added what I think could be the fix in: nathankooij@bf1c189

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions