-
Notifications
You must be signed in to change notification settings - Fork 168
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
RCORE-2210 Remove unused websocket too new/old errors #7917
Conversation
Pull Request Test Coverage Report for Build jonathan.reams_3361Details
💛 - Coveralls |
@@ -94,6 +94,7 @@ class DefaultWebSocketImpl final : public DefaultWebSocket, public Config { | |||
{ | |||
WebSocketError error = WebSocketError::websocket_ok; | |||
bool was_clean = true; | |||
std::string msg = body.empty() ? ec.message() : std::string{body}; |
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 avoid copying the body if it was inline in the call to websocket_error_and_close_handler() as the temporary from message() would live long enough, but I guess that doesn't actually matter.
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
@@ -9,7 +9,7 @@ | |||
* None. | |||
|
|||
### Breaking changes | |||
* None. | |||
* The websocket error codes `websocket_client_too_old`, `websocket_client_too_new`, and `websocket_protocol_mismatch` along with their C API constants were removed. These corresponded to errors the legacy C++ server could have sent, but the baas sync server never did. Any platform networking implementations that surfaced these errors can report a `websocket_fatal_error` instead if an unknown error occurs during the websocket handshake. If a client connects that is too old or too new, it will finish the websocket handshake and then receive an in-band sync `ERROR` message that will be handled by the sync error handler. [PR #7917](https://github.com/realm/realm-core/pull/7917) |
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 guess it's technically a breaking change, but I doubt any of the SDKs with platform networking care about this error (and I doubt they've ever seen it).
What, How & Why?
The 403 error message sent by the C++ legacy server that would cause these websocket errors was never sent by baas and we have no tests for this case. So this is just dead code that should be safe to remove.
I put the changelog entry in the Breaking Changes section since this is a slight API change, but maybe it's more an Internal change?
☑️ ToDos
bindgen/spec.yml
, if public C++ API changed