Uploaded image for project: 'Realm Core'
  1. Realm Core
  2. RCORE-950

Set<Mixed>, Lst<Mixed> do not hide unresolved links well

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • Q1-23FY
    • Affects Version/s: None
    • Component/s: None

      While testing collections of links, I found a difference in behaviour between removing an object and invalidating it. LnkLst/LnkSet hide invalidated links but Lst<Mixed> and Set<Mixed> do not have this capability. If a link in these collections is invalidated it becomes null and the size of the collection is not changed. Furthermore, the stored link is not a true null because operations like find_first(Mixed{}) will return not found.

      T link_collection = {object};
      
      T                   object.invalidate()     object.remove()
      LnkLst              {}                      {}
      Lst<Mixed>          {null} <--*             {}
      LnkSet              {}                      {}
      Set<Mixed>          {null} <--*             {}
      Dictionary<Object>  {key:null}              {key:null}
      Dictionary<Mixed>   {key:null}              {key:null}
      

      I think the easiest thing to do here is to remove the links from these collections instead of storing a link to the invalidated object.

            Assignee:
            nicola.cabiddu@mongodb.com Nicola Cabiddu
            Reporter:
            james.stone@mongodb.com James Stone
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: