question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Inconsistency in behavior of replay

See original GitHub issue

Hey.

I wrote a test and run it on both RxJava and Reaktive and observed different results. Here is the test:

@Test
fun testReplayRefCount() {
    val subject = BehaviorSubject.createDefault(false)
    val sharedStream = subject.replay(1).refCount(1)

    var disposable = sharedStream.test()
    subject.onNext(true)

    disposable.assertValues(false, true)
    disposable.dispose()

    disposable = sharedStream.test()
    subject.onNext(false)

    disposable.assertValues(true, false)
}

As you might guess, running this test with RxJava results in green, while with Reaktive - red. Looks like on second subscription, the internal implementation of replay creates a new ReplaySubject which results in a situation where all subsequent onNext calls are happen for newly created instance and lost for an existing one.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
arkivanovcommented, Feb 24, 2020

Thanks for reporting the bug, I will fix!

1reaction
yevkavalioucommented, Mar 13, 2020

Glad to hear. Frankly speaking, I haven’t expected that this bug will have such consequences - we literally revealed a bug in RxJava itself 😃

I appreciate your work, thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tired of inconsistency in relationships? Signs of emotional ...
Emotional inconsistency is a major form of inconsistent behaviour that people exhibit in relationships. When someone you love gives you mixed signals with ......
Read more >
Hippocampal replay reflects specific past experiences rather ...
Our findings are not consistent with replay of the future arm, current goal, or previous goal influencing the upcoming behavioral choice, but ...
Read more >
HD72300: MACHINING (NCREVIEW) : INCONSISTENT ... - IBM
Machining (NCReview) : Inconsistent behavior when Reading Manufacturing data from a V4 model . Scenario: 1. Start CATIA 2.Select Start + Machining +...
Read more >
His Inconsistent Behavior Is Because Of THIS! - YouTube
FREE Discovery Call with Jonathon▻ https://jonathonaslay.com/coachingJoin My VIP Group for $7-- https://jonathonaslay.com/midlifelove How ...
Read more >
c# - How to fix the inconsistency of the Publish().RefCount ...
Below are the specifications of the desirable behavior: The published sequence should propagate to its subscribers all notifications coming ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found