Smarteon / loxone-java

Java implementation of the Loxone™ communication protocol (Web Socket)
BSD 3-Clause "New" or "Revised" License
15 stars 10 forks source link

Command queue inconsistency #64

Closed jimirocks closed 4 years ago

jimirocks commented 4 years ago
pro 14 13:06:37 heart java[29079]: 2019-12-14 13:06:37.330 DEBUG 29079 --- [   scheduling-1] cz.smarteon.loxone.LoxoneWebSocket       : Sending websocket message: jdev/sps/io/1471d837-00ec-90e3-ffffc0f606ef595c/Pulse
pro 14 13:06:37 heart java[29079]: 2019-12-14 13:06:37.427 ERROR 29079 --- [ctReadThread-36] cz.smarteon.loxone.LoxoneWebSocket       : No command expected!
pro 14 13:06:37 heart java[29079]: java.util.NoSuchElementException: null
pro 14 13:06:37 heart java[29079]:         at java.util.AbstractQueue.remove(AbstractQueue.java:117) ~[na:1.8.0_212]
pro 14 13:06:37 heart java[29079]:         at cz.smarteon.loxone.LoxoneWebSocket.processMessage(LoxoneWebSocket.java:324) ~[loxone-java-0.5.1.jar!/:na]
pro 14 13:06:37 heart java[29079]:         at cz.smarteon.loxone.LoxoneWebsocketClient.onMessage(LoxoneWebsocketClient.java:90) [loxone-java-0.5.1.jar!/:na]
pro 14 13:06:37 heart java[29079]:         at org.java_websocket.client.WebSocketClient.onWebsocketMessage(WebSocketClient.java:462) [Java-WebSocket-1.3.8.jar!/:na]
pro 14 13:06:37 heart java[29079]:         at org.java_websocket.drafts.Draft_6455.processFrame(Draft_6455.java:696) [Java-WebSocket-1.3.8.jar!/:na]
pro 14 13:06:37 heart java[29079]:         at org.java_websocket.WebSocketImpl.decodeFrames(WebSocketImpl.java:367) [Java-WebSocket-1.3.8.jar!/:na]
pro 14 13:06:37 heart java[29079]:         at org.java_websocket.WebSocketImpl.decode(WebSocketImpl.java:212) [Java-WebSocket-1.3.8.jar!/:na]
pro 14 13:06:37 heart java[29079]:         at org.java_websocket.client.WebSocketClient.run(WebSocketClient.java:389) [Java-WebSocket-1.3.8.jar!/:na]
pro 14 13:06:37 heart java[29079]:         at java.lang.Thread.run(Thread.java:748) [na:1.8.0_212]
jimirocks commented 4 years ago

The problem is probably

void sendInternal(final Command command) {
        webSocketClient.send(command.getCommand());
        // it can happen the response on command is received here
        if (! KEEP_ALIVE.getCommand().equals(command.getCommand())) {
            commands.add(command);
        }
    }
jimirocks commented 4 years ago

Accepted as known limitation #91