realm-kotlin icon indicating copy to clipboard operation
realm-kotlin copied to clipboard

RealmDictionary `equals` and `hashCode` are too strict

Open cmelchior opened this issue 2 years ago • 0 comments

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.

cmelchior avatar Aug 14 '23 05:08 cmelchior