Skip to content
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

1.x: fix subscribe(Action1 [, Action1]) to report isUnsubscribed #4716

Merged
merged 1 commit into from
Oct 17, 2016

Conversation

akarnokd
Copy link
Member

The lambda version didn't report isUnsubscribed() as before because of the removal of the SafeSubscriber wrapping. This PR makes sure it reports consistently again.

Repored in: #4715

Note that there is no unsafeSubscribe(SingleSubscriber) so a regular subscribe(SingleSubscriber) by default won't report isUnsubscribed() == true unless the implementation of onSuccess and onError - controlled by the user - doesn't call unsubscribe on itself.

@akarnokd akarnokd added the Bug label Oct 17, 2016
@akarnokd akarnokd added this to the 1.3 milestone Oct 17, 2016
@codecov-io
Copy link

codecov-io commented Oct 17, 2016

Current coverage is 84.09% (diff: 100%)

Merging #4716 into 1.x will increase coverage by <.01%

@@                1.x      #4716   diff @@
==========================================
  Files           288        288          
  Lines         17986      17987     +1   
  Methods           0          0          
  Messages          0          0          
  Branches       2746       2745     -1   
==========================================
+ Hits          15125      15127     +2   
- Misses         1981       1983     +2   
+ Partials        880        877     -3   

Powered by Codecov. Last update 1ac5834...bdbd69f

@akarnokd akarnokd merged commit 6cc1646 into ReactiveX:1.x Oct 17, 2016
@akarnokd akarnokd deleted the SingleIsUnsubscribed branch October 17, 2016 17:16
@marwinxxii
Copy link

Hi everyone,

Seems like subscribe(SingleSubscriber) overload has the same problem, because Single.just(1).subscribe(new SingleSubscriber<Integer>(){...}).isUnsubscribed() returns false.

I checked version 1.2.2-SNAPSHOT. In 1.2.0 it returns true as expected.

@akarnokd
Copy link
Member Author

@marwinxxii Single has no notion of SafeSingleSubscriber and the internals got changed to improve performance. Therefore, you are responsible calling unsubscribe in your implementation of onSuccess and onCompleted.

@marwinxxii
Copy link

Sorry, I missed this part in PR description.

May be this should be added to SingleSubscriber documentation (or may be Single.subscribe(SingleSubscriber)?

@akarnokd
Copy link
Member Author

PR welcome to change the docs.

@marwinxxii
Copy link

Done - #4769

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants