20k SignalR messages when using TreeView

Hi,
I just published my little project to Azure and was testing it until it died. After a fair bit of debugging I found that I had hit the max SignalR messages in 1 minute (20k on Azure free tier) 
I created a new SignalR service and found it did it again as soon as I rendered the Tree View control. 
I have attached a sample. My apologies if it doesn't run.
Thanks for your help.
Regards
Caleb


Attachment: Syncfusion_1a64f5db.zip

5 Replies 1 reply marked as answer

SP Sowmiya Padmanaban Syncfusion Team September 22, 2020 02:33 PM UTC

Hi  Caleb,  
 
Greetings from Syncfusion support. 
 
We have prepared a sample based on your shared code snippet using AppState. Refer the below code snippet. 
 
<p> 
    <div > 
        <SfTreeView @ref="SFTree" TValue="TreeItem" ShowCheckBox="true" AutoCheck="false" AllowMultiSelection="false" >           
            <TreeViewFieldsSettings TValue="TreeItem" Id="Id" DataSource="@TreeItems" Text="FolderName" ParentID="ParentId" IsChecked="IsChecked" HasChildren="HasSubFolders" Expanded="Expanded"></TreeViewFieldsSettings> 
        </SfTreeView> 
    </div> 
</p> 
 
@code 
{  
    SfTreeView<TreeItem> SFTree; 
    public class TreeItem 
    { 
        public string Id { get; set; } 
        public string ParentId { get; set; } 
        public string FolderName { get; set; } 
        public bool Expanded { get; set; } 
        public bool HasSubFolders { get; set; } 
    } 
    List<TreeItem> TreeItems = new List<TreeItem>(); 
    protected override async Task OnInitializedAsync() 
    { 
        this.getFolder(false); 
    } 
 
    public void getFolder(bool forceRefresh) 
    { 
        var allFolders = AppState.GetAllFolders(); // Around 1500 folders             
        var currentSelectedFolder = "A Cool Folder"; 
        var tItems = new List<TreeItem>(); 
        foreach (var gi in allFolders) 
        { 
            tItems.Add(new TreeItem { Id = gi.Id, FolderName = gi.FolderName , HasSubFolders = gi.HasSubFolders}); 
            
        } 
        TreeItems = tItems; 
    } 
} 
 
 
Please, refer the below sample link. 
 
We suspect that your reported issue may be occurred due to if you are using some HTTP method or await method to fetch the datasource for TreeView component. This function takes some time to fetch the datasource for TreeView component. TreeView component does not wait until the data fetched from that function, so it rendered using empty datasource. This may be cause of your reported issue.  We have already logged this as a improvement feature from our end, that feature will be included in our Volume 3 release which is expected to be rolled out at the end of September 2020. 
 
However, we have already prepared a simple sample for signalR for enable and disable Nodes of TreeView component. Refer the below sample link. 
 
 
Could you please ensure the above sample. If the issue still persist, please share the following details. It will help us to resolve your problem at the earliest.  
  
1.     Syncfusion Blazor NuGet package version installed in your application.  
2.     Share the issue replicating video footage.  
3.     If possible, replicate the issue in the attached sample.  
4.     Share us the steps to replicate your reported issue. 
5.     Share the code snippet for AllFolder function inside the Appstate. 
6.     Could you please share the details that time to fetch the datasource of TreeView component. 
 
Please let us know, if you need any further assistance. 
 
Regards,  
Sowmiya.P 



CA Caleb September 22, 2020 10:08 PM UTC

Hi Sowmiya,
Thank you for looking in to the Bug with the Tree View. AS you can see with my code I am not using an await operator when getting the data but yes, the tree view may be initialized with nothing in the dataset. Unfortunately I am unable to debug the Tree View issues at this time and will have to wait for your next release. I just wanted to help your team out, so as long as you are able to reproduce it, all good.
Regards
Caleb



CA Caleb September 22, 2020 10:19 PM UTC

Hi Again,
Sorry, you are correct that if the data was not available when landing on the page I am using an asynch call to get it. 
I can also see your latest release addresses the issue. (https://blazor.syncfusion.com/documentation/release-notes/18.2.59/?type=all)
I'll get back to you if it's all working. 
Thanks again
Caleb


CA Caleb September 22, 2020 10:51 PM UTC

Hi Again,
I have upgraded to the latest version without changing any of my code and the problem persists. Please see the screen shot from the Azure Portal.
My function (GetAllFolders) takes 60 seconds to return when the data is not cached.
Regards
Caleb



SP Sowmiya Padmanaban Syncfusion Team September 23, 2020 10:20 AM UTC

Hi Caleb,  
 
Thanks for your confirmation. 
 
Based on your update, we found that you are using async function to fetch the datasource. As per our previous update, we have already consider this as a issue from our end. This fix will be included in our Volume 3 release which is expected to be rolled out the end of September 2020. 
 
Track the below link to know more about the status for this issue. 
 
 
We appreciate your patience. 
 
Regards,  
Sowmiya.P 


Marked as answer
Loader.
Up arrow icon