Realm Collection Notifications and ChangeSet Filtering
0 reputation · 26 Oct 2024, 23:09 UTC
Fine-grained Notification Management
Realm Java/Kotlin SDKs provide ChangeSet objects within collection listeners to identify specific insertions, deletions, and modifications. While this allows for precise UI updates, a challenge arises when managing high-frequency write operations across large datasets where only a subset of changes is relevant to the current view.
The current behavior triggers a notification whenever any object within the RealmResults set is modified, even if the specific fields being updated are not being observed or displayed. This can lead to excessive callback executions during bulk background synchronization.
Given the constraints of live-updating objects versus the stability of frozen snapshots, how can a listener be configured to ignore updates to specific non-essential fields? Is there a mechanism to filter ChangeSet triggers based on property-level changes rather than object-level modifications?