-
Notifications
You must be signed in to change notification settings - Fork 655
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
⚡ Ignore unknown websocket messages #4066
Conversation
martinbonnin
commented
Apr 27, 2022
- ignore unknown websocket messages
- add a test
✅ Deploy Preview for apollo-android-docs canceled.
|
...e-plugin/src/main/kotlin/com/apollographql/apollo3/gradle/internal/DefaultApolloExtension.kt
Show resolved
Hide resolved
import com.apollographql.apollo3.network.ws.WebSocketEngine | ||
import okio.ByteString | ||
|
||
class FakeWebSocketEngine(val onReceive: suspend () -> String, val onSend: (String) -> Unit) : WebSocketEngine { |
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.
This could be promoted to apollo-testing-support
at some point.
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.
👍
/** | ||
* Parses a WebSocket message containing Json to a Map<String, Any?> | ||
* | ||
* @return the map representing the Json or [null] if the message is not a Json object |
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.
Kind of wondering why it happens
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.
I have no idea but looks like it's a good application of the Robustness principle
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.
💯