android - How to determine does couchbase lite database have local changes? -


i use couchbase lite android. need inform user unsynced local changes lost during log out app. example, user changes data during offline work , wants log out.

does know way check that?

the database object has lastsequencenumber property. every new revision assigned new sequence number, property increases monotonically changes made database. can used check whether database has changed between 2 points in time.

when replication has completed, store last sequence number local document or in shared preferences on android , when user logs out, compare 1 saved , 1 set on database. if database's last sequence greater 1 tracking, display popup notify user x changes saved (inserts, updates, deletes) not synced.


Comments

Popular posts from this blog

javascript - Google App Script ContentService downloadAsFile not working -

javascript - Function overwritting -

php - Find a regex to take part of Email -