realm / realm-kotlin

Kotlin Multiplatform and Android SDK for the Realm Mobile Database: Build Better Apps Faster.
Apache License 2.0
942 stars 57 forks source link

Check if there are pending changes to synchronize #1613

Open clementetb opened 9 months ago

clementetb commented 9 months ago

We like to have a way to check if there are changes in the db that have not been synchronized.

There are some situations where the app might be offline, and some changes have occurred, this feature would allow us to detect this situation and react to it, allowing the app to display a warning message that it requires some connectivity.

A workaround is to combine a Realm, session change and progress listeners, to detect if the DB is in a dirty state, and if all changes have been uploaded.

We would provide an API to check if there are pending changes, and/or a flow with the current status.

danieltabacaru commented 7 months ago

all this data is already available in the sync client so we can easily expose it