-
Notifications
You must be signed in to change notification settings - Fork 726
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
Invalid HTTP upgrade spams the log instead of returning an error #3325
Comments
Hi @sgade
Is this implying the behaviour was different in earlier versions, i.e.: < 1.6.0? |
Hi @calvincestari, thanks for asking. I meant that the issue was happening in 1.6.0 but I upgraded to 1.8.0 and noticed the same behavior. On further inspection, it seems the code in |
I don't think |
Hi @sgade, I took a look into the issue this morning and it's not a bug but rather a combination of the What you're seeing is a result of the default values for:
I'm going to close this issue as the websocket behaviour is normal and I recommend adjusting those configuration values to better suit the network environment you're operating in. |
Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo iOS usage and allow us to serve you better. |
Thanks for the clarification, @calvincestari. Although I'm not a fan of these defaults, I can now understand what is happening. Is there any way you could provide more control over these log messages? Instead of logging, a library should instead pass the error around. Even if the delegate gets called, the message is still printed to stdout. Since Apple is recommending to use |
They are configurable through the
I'll take a look at that logging behaviour later today and get back to you. |
I've got a PR up to remove those logging calls, they serve no purpose - apollographql/apollo-ios-dev#253. |
Looks great, thanks! |
Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo iOS usage and allow us to serve you better. |
Summary
When connecting to an invalid web socket connection,, Apollo's
WebSocketTransport
is continuously printing (about every second) the error to stdout.The message is printed in this line:
apollo-ios/Sources/ApolloWebSocket/WebSocketTransport.swift
Line 531 in 1d9b926
This is happening because the
previousState
is.disconnected
inhandleDisconnection(with:)
Bug noticed first in 1.6.0 but verified with 1.8.0.
I would expect this to give up immediately because no connection is possible at all. Since this is not even sending out any requests right now, is there a way we are supposed to be able to handle this gracefully in our code?
Version
1.8.0
Steps to reproduce the behavior
SplitNetworkTransport
with aWebSocketTransport
that uses an unsupportedURL
likews://www.google.com
. The http code is of course dependent on the remote server.Logs
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: