Inconsistency in behavior of replay
See original GitHub issueHey.
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:
- Created 4 years ago
- Comments:5 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for reporting the bug, I will fix!
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!