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

Thrown URLError cancels the remaining URL requests and results in returning incomplete connectivity result #13

Open
hatalyakgyula opened this issue May 17, 2024 · 0 comments

Comments

@hatalyakgyula
Copy link

The following configuration is very similar to the default one but replaces one of the URLs with an unreachable one that would produce a thrown URLError during URLSession's dataTask.

let config = HyperconnectivityConfiguration(connectivityURLs: [URL(string: "https://www.apple.com/library/test/success.html"),
                                                               URL(string: "https://ab.cd.ef/123.html")].compactMap { $0 },
                                            successThreshold: Percentage(50))

According to my testing the thrown URLError happens pretty quickly and with the current implementation it will make the MergeMany publisher to complete (here)and this way cancelling all remaining/ongoing URL requests. Despite of requiring less then 100% as success threshold only one early-failing request with a thrown error can stop the MergeMany publisher and leave the ConnectivityResult in an incomplete state - that is returned to the subscriber of ConnectivityPublisher.
So in case of the example I provided above only one failed URL request results in a disconnected state despite of setting only 50% as a success threshold.
Could you please check the example and give some feedback if you also consider it as a bug?

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