private void removeSessionsManagerIfEmpty(
            @NotNull CloseReason closeReason,
            @NotNull UserSessionsManager manager,
            @NotNull Long userId) {
        if (manager.countSessions() == 0) {
            userIdToSessionsManager.remove(userId);
        }
        pluginManager
                .invokeExtensionPointsSimultaneously(UserOnlineStatusChangeHandler.class,
                        GO_OFFLINE_METHOD,
                        handler -> handler.goOffline(manager, closeReason))
                .subscribe(null, LOGGER::error);
    }
For the case that the client recovers from UDP to TCP/WebSocket: Return the local session if
the client connects to the machine that owns the existing session; Return a new session and
disconnect the remote session if the existing session is on a different machine.
turms-gateway/src/main/java/im/turms/gateway/domain/session/service/SessionService.java