NXP-10414: make sure not to save the last sync date if there is a network issue while regreshing the DB
NXP-10414: more debug logs and finer online state notification updates
NXP-10414: fixed the sleeping computation logic