Receiver
Receiver copied to clipboard
test_MultipleListeners() failing with Xcode 10.1
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
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...
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.