-
Type: Task
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Sync
-
None
-
2 - S (<= 1 week)
-
7613
-
Not Needed
The latest updates to App and the app tests in Core master has removed the old testing for both a HTTP 308 and websocket 4003 error responses and only tests the HTTP 308 response. Update this test to include both types of return values from the server.
Original test: https://github.com/realm/realm-core/blob/4d815c6e6883bfdcb67cf755d0f0f29a4b399ea7/test/object-store/sync/app.cpp#L2988-L2996
redir_provider->websocket_connect_func = [&logger, &connect_count]() -> std::optional<SocketProviderError> { logger->trace("websocket connect (%1)", ++connect_count); if (connect_count == 1) return SocketProviderError(sync::HTTPStatus::PermanentRedirect); if (connect_count == 2) return SocketProviderError(sync::websocket::WebSocketError::websocket_moved_permanently); return std::nullopt; };
Updated test: https://github.com/realm/realm-core/blob/master/test/object-store/sync/app.cpp#L3462-L3470
socket_provider->websocket_connect_func = [&]() -> std::optional<SocketProviderError> { // Report a 308 response the first time we try to reconnect the websocket, // which should result in App performing a location update. // The actual Location header isn't used when we get a redirect on // the websocket, so we don't need to supply it here if (connect_count++ > 0) return std::nullopt; return sync::HTTPStatus::PermanentRedirect; };