Circular Reference Hangs/Crashes SfGrid when trying to Edit

It seems that if the instances of TValue in a data grid contain circular references, then attempting to edit a row/cell will hang/crash the blazor server.  It will also be impossible to pause the debugger.


public class Customer {

  public long CustomerID { getset; }

  ICollection<Contact> Contacts { getset; }

}

public class Contact {

  public long ContactID { getset; }

  public string Name { getset; }

  public long CustomerID { getset; }

  public Customer Customer { getset; }

}

<SfGrid TValue=@Customer 
        DataSource=@MyCustomer.Contacts/>
        

6 Replies

JP Jeevakanth Palaniappan Syncfusion Team March 12, 2021 01:23 PM UTC

Hi Mark, 

Greetings from Syncfusion support. 

We have validated your query by binding circular reference model but we are unable to reproduce the reported problem from our end. We have attached the validated sample elow for your reference. 


If you are still facing the issue then kindly share us the below details, 

  1. Share us the Syncfusion NuGet version.
  2. Share us the complete rendering code and the way you have binding the datasource.
  3. Kindly share us the issue reproducing sample or reproduce the issue in the provided sample.

The above requested details will be helpful for us to validate the issue and provide you with a better solution as early as possible. 

Regards, 
Jeevakanth SP. 



MS Mark Schad March 14, 2021 03:39 AM UTC

Thanks for your reply, I have updated a modified solution which should reproduce for you the problem.

I realise that there was a third class needed to cause the problem.



@page "/"

@using Syncfusion.Blazor.Grids

<SfGrid TValue=@Contact
        DataSource=@SelectedJob.Customer.Contacts>
    <GridEditSettings AllowAdding="true" AllowDeleting="true" AllowEditing="true" Mode="EditMode.Normal"></GridEditSettings>
    <GridColumns>
        <GridColumn Field="@nameof(Contact.ContactID)" IsPrimaryKey="true"></GridColumn>
        <GridColumn Field="@nameof(Contact.Name)"></GridColumn>
        <GridColumn Field="@nameof(Contact.CustomerID)"></GridColumn>
    </GridColumns>
</SfGrid>

@code{

    public Job SelectedJob { getset; }

    protected override void OnInitialized() {

        var job = new Job() {
            JobID = 1,
        };

        var customer = new Customer {
            CustomerID = 1,
        };

        job.Customer = customer;
        customer.Job = job;

        customer.Contacts = Enumerable.Range(175).Select(x => new Contact() {
            ContactID = x,
            Name = (new string[] { "ALFKI""ANANTR""ANTON""BLONP""BOLID" })[new Random().Next(5)],
            CustomerID = 1,
            Customer = customer,
        }).ToList();

        SelectedJob = job;
    }
    public class Customer {
        public long CustomerID { getset; }
        public long JobID { getset; }
        public Job Job { getset; }
        public ICollection<ContactContacts { getset; }
    }

    public class Contact {
        public long ContactID { getset; }
        public string Name { getset; }
        public long CustomerID { getset; }
        public Customer Customer { getset; }
    }

    public class Job {
        public long JobID { getset; }
        public long CustomerID { getset; }
        public Customer Customer { getset; }
    }
}

Attachment: DataGridUpdated_85bbe1da.zip


JP Jeevakanth Palaniappan Syncfusion Team March 17, 2021 02:41 PM UTC

Hi Mark, 
 
Thanks for the issue reproducing sample. 
 
We have validated your query and we have considered it as a bug and logged the defect report “Stackoverflow exception occurs on editing a record when grid datasource is bounded with circular reference”. Thank you for taking the time to report this issue and helping us improve our product. At Syncfusion, we are committed to fixing all validated defects (subject to technological feasibility and Product Development Life Cycle ) and including the defect fix in our upcoming patch release which is expected to be rolled out on or before end of April, 2021.  Until then we appreciate your patience. 
   
You can now track the current status of your request, review the proposed resolution timeline, and contact us for any further inquiries through this link.       
  
 
Regards, 
Jeevakanth SP. 



JP Jeevakanth Palaniappan Syncfusion Team August 25, 2021 05:11 AM UTC

Hi Mark, 

Sorry for the inconvenience. 
   
Due to unforeseen circumstances, we are unable to include the fix “Stackoverflow exception occurs on editing a record when grid datasource is bounded with circular reference” in our patch release as promised. This will be included in our Volume 3,2021 release. Until then we appreciate your patience. 
 
You can now track the current status of your request, review the proposed resolution timeline, and contact us for any further inquiries through this link.    
 
Regards, 
Jeevakanth SP. 



JP Jeevakanth Palaniappan Syncfusion Team October 4, 2021 12:23 PM UTC

Hi Mark,  
 
Sorry for the inconvenience.  
  
Due to unforeseen circumstances, we are unable to include the fix “ Stackoverflow exception occurs on editing a record when grid datasource is bounded with circular reference” in our patch release as promised. This will be included in our upcoming patch release which is expected to be rolled out by the mid of October 2021. Until then we appreciate your patience.   
  
You can now track the current status of your request, review the proposed resolution timeline, and contact us for any further inquiries through this link.     
  
Regards,  
Jeevakanth SP 



VN Vignesh Natarajan Syncfusion Team January 3, 2022 05:13 AM UTC

Hi Mark 
 
We are glad to announce that, we have resolved the reported issue “Stackoverflow exception occurs on editing a record when grid datasource is bounded with circular reference”. So please upgrade to our latest version of Syncfusion NuGet package to resolve the reported issue. Please find the Nuget package and release notes for latest fixes and features from below.  
 
 
We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance.   
    
Regards,              
Vignesh Natarajan 
 


Loader.
Up arrow icon