Realm Sync of nested recursive list

I have an object that contains this (simplified) object

    public class RepairDiagnosticLevel : EmbeddedObject
        public int DiagnosticLevelID { get; set; }
        public string DisplayName { get; set; }
        public IList<RepairDiagnosticLevel> DiagnosticLevel { get; }

As you can see the list is recursive. When I log in to my app, it attempts to data sync this new model (and its parent) but I get this error

Cycles containing embedded objects are not currently supported: ‘RepairDiagnosticLevel.diagnosticLevel’

can anyone confirm that Realm sync should allow recursion like this and if so, what might cause this exception when logging in?

The collection does not currently exist in MongoDB. I’m in dev mode so expecting my new model to create the new collection.
Thank you.

Unfortunately we do not currently support cyclic lists containing embedded objects (which would be your nested recursive/cyclic list IList<RepairDiagnosticLevel> in this case) so you may want to consider restructuring your data model to either avoid recursion/cycles in the list or not use embedded objects as the list’s elements.

1 Like

Thank you Gagik for the quick reply.


1 Like