When a request to the remote database (eg. http://localhost:5984
) fails because the database can not be reached, I would like to show an indicator to the user they are offline.
However, using the following sync-setup, the error
handler does not get triggered when the connection fails. It only get's triggered if the database connection can not be established when setting up the sync. But if the database goes down later on, it seems like the error
callback isn't triggered. But I'd also like to get notified for this.
My synchronisation setup:
localDb
.sync(remoteDb, {
live: true,
retry: true
})
.on('error', function () {
// I would expect this handler to be called when the connection goes down
});
My question is what callback get's triggered after the initial sync has been setup setup and the database can not be reached later on?