Every method in SocketRpcClient.java follows the same pattern:
CompletableFuture<T> result = new CompletableFuture<>();
socket.emit(EVENT, args, (Ack) args -> { result.complete(...); });
return result;
None of these have a timeout. If the ack never comes back, dropped connection mid request, server restarts, or literally the exact case checkSessionPassword's own comment calls out ("An older server has no handler for this event and never acks"), the future just sits there forever. Nothing ever calls completeExceptionally or times it out on its own.
This hits basically the whole file: getDBUserBuildingsViaSocket, getSessionListViaSocket, getSessionViaSocket, getSessionMessagesViaSocket, getSessionUsersViaSocket, getFriends, searchUsers, all four friendAction wrappers (send/accept/reject/remove friend), checkSessionPassword, and buyBuilding.
Whatever is waiting on one of these (a loading spinner, a disabled buy button, the friends panel) just hangs indefinitely with no way to recover unless something else notices and reconnects the socket. Feels like these should all get a reasonable timeout, something like orTimeout(10, TimeUnit.SECONDS) so they fail loud instead of hanging silently forever.
File: core/src/com/focus/kingdom/network/socket/SocketRpcClient.java, applies to basically every method in the file.
Every method in SocketRpcClient.java follows the same pattern:
None of these have a timeout. If the ack never comes back, dropped connection mid request, server restarts, or literally the exact case
checkSessionPassword's own comment calls out ("An older server has no handler for this event and never acks"), the future just sits there forever. Nothing ever callscompleteExceptionallyor times it out on its own.This hits basically the whole file:
getDBUserBuildingsViaSocket,getSessionListViaSocket,getSessionViaSocket,getSessionMessagesViaSocket,getSessionUsersViaSocket,getFriends,searchUsers, all fourfriendActionwrappers (send/accept/reject/remove friend),checkSessionPassword, andbuyBuilding.Whatever is waiting on one of these (a loading spinner, a disabled buy button, the friends panel) just hangs indefinitely with no way to recover unless something else notices and reconnects the socket. Feels like these should all get a reasonable timeout, something like
orTimeout(10, TimeUnit.SECONDS)so they fail loud instead of hanging silently forever.File:
core/src/com/focus/kingdom/network/socket/SocketRpcClient.java, applies to basically every method in the file.