Self-referencing loop error

Hello,

I'm using your Blazor components (v18.2.0.44) in a project that gets its data via EF Core.  The latest update to the controls fixed a problem with self referencing loops on a Syncfusion Grid (amongst other things).  But I think the problem remains with Syncfusion Charts.

I added a chart tab to a razor component, similar to the Master-Detail tutorial on your blogs.  Got the same error as was shown with the Grid before.  So I decorated the relationship property in the relevant class with [JsonIgnore] and [IgnoreDataMember].  No other changes to the code, but now the chart renders fine.

So perhaps the serialization is still used for components other than the grid?  If not, I'll share some code so as to troubleshoot further.

Many thanks

15 Replies

SM Srihari Muthukaruppan Syncfusion Team July 13, 2020 12:30 PM UTC

Hi Sebastian, 
  
We are analyzing your query and we will update the status within two business days (July 15, 2020). We appreciate your patience until then. 
  
Regards, 
Srihari M 




DG Durga Gopalakrishnan Syncfusion Team July 15, 2020 02:47 PM UTC

Hi Sebastian, 

We have validated your reported scenario. Unfortunately, we are unable to reproduce an issue. We have prepared sample for your reference. Please check with the below link. 

Sample 

Since we are unaware of your exact scenario in which an issue is reproduced, please share the following information which will be more helpful for further analysis and provide you the solution sooner. 
  • Try to reproduce the reported scenario in the above sample.
  • Please share your sample (or) code snippet with full configurations.
  • Share the details if you have done any other customization in your sample.
  • Share your data source file.
  • Share your preview template version.

Kindly revert us, if you have any concerns. 

Regards, 
Durga G 



SC Sebastian Crewe July 16, 2020 03:58 PM UTC

Dear Durga,

Thank you for your response and for the sample project.

I think the main difference between the sample and my project is that I'm using EF Core to retrieve the data.  The underlying database has relationships between various tables - these get converted into relationship properties within the relevant classes in the solution.

In my case, I've got a Prices table and an Instruments table - one instrument, many prices.  My Instruments class is as follows:

public partial class Instruments
    {
        public Instruments()
        {
            Holdings = new HashSet<Holdings>();
            Prices = new HashSet<Prices>();
        }

        public int InstrumentId { get; set; }
        public string InstrumentName { get; set; }
        public string Ussymbol { get; set; }
        public string Ftsymbol { get; set; }
        public string YahooSymbol { get; set; }
        public string Sedol { get; set; }
        public string Isin { get; set; }
        public string LocalCurrency { get; set; }
        public short IsFund { get; set; }
        public DateTime? CreatedDate { get; set; }
        public DateTime? UpdatedDate { get; set; }

        public virtual ICollection<Holdings> Holdings { get; set; }
        public virtual ICollection<Prices> Prices { get; set; }
    }

While my Prices class looks like:

    public partial class Prices
    {
        public int PriceId { get; set; }
        public int InstrumentId { get; set; }
        public DateTime PriceDate { get; set; }
        public decimal CurrentPriceUsd { get; set; }
        public decimal CurrentPriceGbp { get; set; }
        public decimal OpenPriceUsd { get; set; }
        public decimal OpenPriceGbp { get; set; }
        public decimal HighPriceUsd { get; set; }
        public decimal HighPriceGbp { get; set; }
        public decimal LowPriceUsd { get; set; }
        public decimal LowPriceGbp { get; set; }
        public decimal PreviousClosePriceUsd { get; set; }
        public decimal PreviousClosePriceGbp { get; set; }
        public DateTime? CreatedDate { get; set; }

        [JsonIgnore]
        [IgnoreDataMember]
        public virtual Instruments Instrument { get; set; }
    }

These classes are generated automatically by using the 'dotnet ef dbcontext scaffold' approach. Without those decorators on 'public virtual Instruments Instrument', I get the circular reference error when I open a chart that is in the Detail Template of a grid showing a list of instruments:

Error: System.AggregateException: One or more errors occurred. (Self referencing loop detected with type 'ComputenceWebApp.Data.Prices'. Path 'series[0].dataSource[0].Instrument.Prices'.) 

The data source for the page is the Instruments, plus an Include to get the related prices:

return await _context.Instruments.OrderBy(s => s.InstrumentName)
                    .Include(m => m.Prices)
                    .ToListAsync();

The chart itself is rendered on the page within a tab:

                            <TabItem>
                                <ChildContent>
                                    <TabHeader Text="Chart View"></TabHeader>
                                </ChildContent>
                                <ContentTemplate>
                                    <SfChart Title="Price History">
                                        <ChartPrimaryXAxis ValueType="ValueType.DateTime"></ChartPrimaryXAxis>
                                        <ChartSeriesCollection>
                                            <ChartSeries DataSource="@instrument.Prices.Where(x => x.CurrentPriceUsd > 0).OrderBy(p => p.PriceDate)" XName="@nameof(Prices.PriceDate)" YName="@nameof(Prices.CurrentPriceUsd)" Type="ChartSeriesType.Line"></ChartSeries>
                                        </ChartSeriesCollection>
                                    </SfChart>
                                </ContentTemplate>
                            </TabItem>

All works beautifully as long as the Prices class has those two decorators ([JsonIgnore] and [IgnoreDataMember]) on the relationship property.

I had experienced exactly the same error message with the Grid.  I posted a question and was lucky enough to get the response that v18.2.0.44 would fix it.  Which it did.  That's why I was wondering if there are still cases where you still need to use the serialization/deserialization methods.

Does the above shed any light at your end on where the problem might lie?

Many thanks and best wishes,

Sebastian


SM Srihari Muthukaruppan Syncfusion Team July 21, 2020 12:22 PM UTC

Hi Sebastian,

We have analyzed your query. From that, we would like to let you know that as of now the chart needs serialization to render. We consider this scenario as an improvement and we have logged a feature request on this. It can be tracked through our feedback portal below. 

Feedback Portal: https://www.syncfusion.com/feedback/16288/need-to-render-chart-without-serialization

We will include this feature in EJ2 on our volume 3 release Which is scheduled to be rolled out by the end of September 2020. We appreciate your patience until then.

Let us know if you have any concerns.

Regards,
Srihari M



SC Sebastian Crewe July 21, 2020 02:28 PM UTC

That's quite understood.  Happy to wait.

Thank you for your willingness to check, test and accept there's room for improvement.

I guess it would be helpful for users to know exactly which controls still use serialization and hence need the decorators on the related tables.  Not required for Grids, is required for Charts and ... ?  Would there be room in the documentation for this?

Best wishes


SM Srihari Muthukaruppan Syncfusion Team July 22, 2020 01:59 PM UTC

Hi Sebastian

We have forwarded your query to the respective teams. Hence, we will check and update the status within two business days (July 24, 2020). We appreciate your patience until then. 
  
Regards, 
Srihari M



SM Srihari Muthukaruppan Syncfusion Team July 24, 2020 01:10 PM UTC

Hi Sebastian, 
  
Please find the response from the respective team for the query. 
  
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>  
Grid: We have handled serialization in the grid source-level itself. 
  
Pivot Table: We will include the serialization fix in Volume 3 release. 
  
Form: In our components, we have already handled the serialization in source code   


 
Barcode: Serialization is not applicable for Barcode component  


 
Diagram: we have already handled the serialization in source code  


 
TreeGrid: We have already handled Serialization in our TreeGrid source code.  


 
RTE team (Dialog, splitter, Inplace-editor, Toast and RichTextEditor): Serialization is not appplicable for our Team components 


 
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>  
Let us know if you have any concerns. 


 
Regards, 
Srihari M  



SC Sebastian Crewe July 25, 2020 11:00 AM UTC

Your responsiveness does you great credit.  This is very useful to me and I hope will be to others.

Thank you very much for following through so thoroughly.

Best wishes


SM Srihari Muthukaruppan Syncfusion Team July 27, 2020 06:43 AM UTC

Hi Sebastian 
  
Most welcome. Kindly get in touch with us, if you would require further assistance. We are always happy in assisting you.    
    
Thanks,    
Srihari M  



SM Srihari Muthukaruppan Syncfusion Team October 6, 2020 03:21 PM UTC

Hi Sebastian,  
  
Sorry for the inconvenience.  
   
Due to some technical difficulties, we couldn't include this in our volume 3 release. We will include this feature in our volume 4 release which is expected to be rolled out by the mid of December 2020. We appreciate your patience until then.  
   
Regards,  
Srihari 



SS Sarasilmiya Shahul Hameed Syncfusion Team October 8, 2020 04:30 AM UTC

From: Sebastian Crewe
Sent: Wednesday, October 7, 2020 9:17 AM
Subject: RE: Syncfusion support community forum 155977, Self-referencing loop error , has been updated. 

 
Hello, 
 
Thank you for your message.  I appreciate you keeping me updated with progress (even if delayed).  Your ticketing system is clearly a good one – and should be adopted by some of the public health bodies we have here in the UK. 
 
With best wishes, 
 
Sebastian 



SM Srihari Muthukaruppan Syncfusion Team October 8, 2020 02:31 PM UTC

Hi Sebastian,   
   
Thanks for the update. 
 
We will let you know once our volume 4 release is rolled out. We appreciate your patience until then. 
     
Thanks,     
Srihari M   



SM Srihari Muthukaruppan Syncfusion Team December 21, 2020 11:46 AM UTC

Hi Sebastian, 
 
Sorry for the inconvenience.   
    
Due to complexity in implementation, we are unable include this feature in our volume 4 release. We will consider this feature in our volume 1 release which is expected to be rolled out by the end of March 2021. We appreciate your patience until then.   
    
Regards,   
Srihari 



DG Durga Gopalakrishnan Syncfusion Team April 2, 2021 11:13 AM UTC

Hi Sebastian, 
 
We regret for inconvenience caused. This feature will be available in our upcoming Volume 2 Main Release which is expected to be rolled out at end of June 2021. We appreciate your patience until then. 
 
Regards, 
Durga G 



SM Srihari Muthukaruppan Syncfusion Team April 15, 2021 12:29 PM UTC

Hi Sebastian, 
  
Thanks for your patience. 
  
We are glad to announce that our v19.1.56 patch release is rolled out. We have added the fix for the reported scenario in our native rendering. And you can use the latest (19.1.56) blazor nugget version to overcome the reported scenario. We have also prepared a sample for your reference. Please find the sample and screenshot for your reference. 
  
  
Screenshot: 
 
  
We appreciate your patience in waiting for this release. Kindly let us know if you need further assistance.  
  
Regards, 
Srihari 


Loader.
Up arrow icon