-
Notifications
You must be signed in to change notification settings - Fork 7.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2.x: Fix refCount eager disconnect not resetting the connection #6297
Conversation
Codecov Report
@@ Coverage Diff @@
## 2.x #6297 +/- ##
============================================
+ Coverage 98.24% 98.28% +0.04%
- Complexity 6281 6286 +5
============================================
Files 672 672
Lines 44980 44992 +12
Branches 6219 6223 +4
============================================
+ Hits 44189 44221 +32
+ Misses 251 241 -10
+ Partials 540 530 -10
Continue to review full report at Codecov.
|
.replay(1) | ||
.refCount(); | ||
|
||
// This line causes the test to fail. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: "caused"
.replay(1) | ||
.refCount(); | ||
|
||
observable.takeUntil(Observable.just(1)).test(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistency, this line either needs same comment as flowable test, or it should be removed from flowable test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed from the other place.
This PR fixes the case when an observer/subscriber disposes/cancels immediately upon subscribing to a
refCount
operator before it establishes the connection and ends up with a disposed but non-reset connection, preventing further interactions with the connectable source.The fix is to detect this case and reset the connection when the
connect()
method signals the dispose handler.Both
ConnectableFlowable.refCount
andConnectableFlowable.refCount
is affected.Fixes: #6296