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
one of HmsSettings apply functions recurses indefinitely (huawei-push-kit) #142
Conversation
@@ -123,7 +123,8 @@ object HmsSettings { | |||
def apply( | |||
appId: String, | |||
appSecret: String, | |||
forwardProxy: Option[ForwardProxy]): HmsSettings = apply(appId, appSecret, forwardProxy) | |||
forwardProxy: Option[ForwardProxy]): HmsSettings = | |||
apply(appId, appSecret, IsTest, MaxConcurrentConnections, forwardProxy) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ill approve although I don't really like unit tests that are testing just the compiler. Since we are going to integrate Scala 3 into pekko-connectors anyways (which as you said catches this at compile time), I would prefer not having the test or alternately creating an issue to remove it when we add scala 3 support.
I'm not testing the compiler - I'm testing that the call completes ok - the test runs into an indefinite loop without my fix |
Yes I know, I didn't expressive well. What I mean is that I am not a fan of unit tests that are covering for issues that the compiler should detect/show mainly because you can argue "why don't we just add a unit test for every possible apply method that can create an infinite recursive loop". Put differently the test sticks out as a sore thumb, and the impression of someone else reading this test for the first time would be "why is it only this function that has this problem" when this is not the case. This has also revealed that huawei pushkit evidently doesn't have good enough integration test coverage (which would not only uncover this issue but actually test the library in general). As I said though, I wouldn't be saying this if Scala 3 didn't happen to catch this. |
@mdedetrich unfortunately, the Scala 3 build just logs a warning - it does not fail We can play around with the Scala 3 settings to see if we can make the warnings lead to a build failure. |
Unless I am mistaken any warning can be turned into a fatal error, so this shouldn't be an issue
👍 |
create
method uses the brokenapply
functionapply
function and passing on the default values for the 2 extra params that are needed