From time to time your client application may lose its connection to the wolkenkit application, e.g. because of network issues.

If the connection gets lost the client application will emit a disconnected event. Once you receive this event you should stop sending commands, and let the user know that they are currently not able to work.

app.on('disconnected', () => {
// ...
});

Whenever the client application establishes a connection to the wolkenkit application again, it emits a connected event:

app.on('connected', () => {
// ...
});

Reload on connected

Even if a connection gets established again, the client application and the wolkenkit application need to be synchronized again. Hence it is recommended to reload the client application. You may use the connected event to do this automatically.