Skip to content
This repository has been archived by the owner on Dec 12, 2021. It is now read-only.

Fix double subscription bug #19

Merged
merged 2 commits into from
Mar 13, 2018
Merged

Fix double subscription bug #19

merged 2 commits into from
Mar 13, 2018

Conversation

haritowa
Copy link
Contributor

@haritowa haritowa commented Mar 4, 2018

Hello, my team recently start a transition to RxSwfit 4.x, as far as I can see, RxAutomaton does not have rxswift 4 branch and HEAD dependency is ~> 4.0.0. After manual transition(plain dependency bump) we have observed strange behavior: RxAutomaton subscribes to each cold edge twice.

The bug was caused by updated .share operator, which now have two parameters(replay elements count and strategy) with strange default values: by default new share behavior differs from the old one.

My PR contains three commits:

  • dependency bump
  • test case, that exposes a bug(5b2431a)
  • fix (44703bf)

So far, this is the only critical issue, caused by the transition to RxSwift 4.x, maybe we should perform needed tests/warning fixes and bump dependency version?

@haritowa
Copy link
Contributor Author

haritowa commented Mar 4, 2018

You can run tests using 5b2431a version and observe the bug yourself

@inamiy
Copy link
Owner

inamiy commented Mar 5, 2018

@haritowa
Thanks for catch!
Fixes look good, except f81ad93 having wrong configuration and not really needed for this pull request.

Can you revert f81ad93 ?

P.S. Discussion of .share's default scope can be found here: ReactiveX/RxSwift#1527

@haritowa
Copy link
Contributor Author

If I'll revert dependency bump - code will not compile, is it ok?)

@inamiy
Copy link
Owner

inamiy commented Mar 11, 2018

I don't think reverting f81ad93 will break the code.
At least, s.dependency "RxSwift", "~> 5.0" is currently not available as in f81ad93.

@haritowa
Copy link
Contributor Author

Ooops, I thought ~> 5.0 means 4.0 ..< 5.0, ok, I'll drop that commit

Copy link
Owner

@inamiy inamiy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for contribution!

@inamiy inamiy merged commit 7bbcb35 into inamiy:swift/4.0 Mar 13, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants