Lets just discuss on that issue rather than just duplicating everything.
But as I mentioned on the second issue you filed for the messages (https://github.com/espruino/Espruino/issues/2112) deleting messages on disconnect is expected. It didn't always happen but this behaviour was explicitly requested by someone else in another Github issue.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
This issue: https://github.com/espruino/Espruino/issues/2113
Lets just discuss on that issue rather than just duplicating everything.
But as I mentioned on the second issue you filed for the messages (https://github.com/espruino/Espruino/issues/2112) deleting messages on disconnect is expected. It didn't always happen but this behaviour was explicitly requested by someone else in another Github issue.