realm-kotlin
realm-kotlin copied to clipboard
RealmDictionary `equals` and `hashCode` are too strict
With https://github.com/realm/realm-kotlin/issues/1097 being fixed, we should revisit the hashCode and equals implementations of RealmDictionary and their associated KeySet implementations. They are only returning true for identical instances, which is too strict. We should use the same algorithm as for RealmObjects, i.e. dictionaries are considered equal if:
- They have the same parent object
- They are associated with the same property in the parent object
- They have the same version
- They have the same Realm.