sendQueuedCommands does not seem to work?

michael ring4 years ago

Are you talking about this API response?

{"id":0,"attributes":{"data":"setparam 13003:1"},"deviceId":118,"type":"custom","textChannel":false,"description":"New..."}

It is the same response ne matter if it working because device is only or if it is not working because device is offline.

Anton Tananaev4 years ago

What about response code?

michael ring4 years ago

This is the response.
I am using google chrome + F12 => network

And I have a look at http://localhost:8083/api/commands/send (localhost:8083 is SSH tunnel to production server)

When I look at headers => request payload source, this is displayed:

{"id":0,"description":"New...","deviceId":58,"type":"custom","textChannel":false,"attributes":{"data":"359633108423943"}}

When I look at response, this is displayed:

{"id":0,"attributes":{"data":"359633108423943"},"deviceId":58,"type":"custom","textChannel":false,"description":"New..."}

Request and response seems to be identical. Am I doing something wrong?

Anton Tananaev4 years ago

Unfortunately you haven't answered my question. I don't see response codes anywhere.

michael ring4 years ago

Good news is: the queued commands are working fine :-)

Sorry, it was my mistake. There were still some debugging adds in the code and this must have corrupted the commands. After rebuilding the version with your original code it works again. I thought I had tried this two days ago, but I must have sent command to wrong device...
And after looking deeper in the server logs I found out that the first lost command reported by user was lost because of server reboot. So no bug at all. All just came up because the command queue is lost when server restarts.

Did you ever think about a new db table were all not sent command would be stored. And sucsessfully sent commands could be deleted from this table.