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

test_MultipleListeners() failing with Xcode 10.1 #11

Open
kevincador opened this issue Dec 27, 2018 · 2 comments
Open

test_MultipleListeners() failing with Xcode 10.1 #11

kevincador opened this issue Dec 27, 2018 · 2 comments

Comments

@kevincador
Copy link
Contributor

kevincador commented Dec 27, 2018

Hey,

I discovered an issue (probably due to iOS 12/Swift 4.2/Xcode 10) that breaks the ability to have multiple listeners. Basically, only the first listener seems to receive the broadcasts.

I ran the tests on the latest version here and test_MultipleListeners() fails. Running on Xcode 10.1.

Thanks for your feedback!

Kevin

@kevincador
Copy link
Contributor Author

I think I identified the issue. It's when a key needs to be generated to store the handler:

_key = (_handlers.keys.map { $0.hashValue }.max() ?? -1) + 1

It seems like the keys are always the same at some point.

I'm still investiguating.

If you can explain the logic here for the key, I can try to fix it myself and make a pull request. If it helps...

@kevincador
Copy link
Contributor Author

It works as expected when removing the hashValue:

_key = (_handlers.keys.max() ?? -1) + 1

I don't really understand why this hashValue is important.

Let me know if I can help further.

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

No branches or pull requests

1 participant