I have two resource groups on my SfSchedule control, Users and Projects. I get a list of events and create two list objects for the groups based on the events returned. Whenever the list of events is changed or a filter is applied, I recreate the datasource for the scheduler and update the User and Project resource lists.
If I filter the events by user, no exception gets thrown. However, if I edit an event and amend either the user or the project, a null reference exception is thrown. It does not matter if the user/project combination already exists, an exception always gets thrown.
Why does editting an event cause this exception but using the filter does not? Such catastrophic errors are becoming more commonplace and are incredibly frustrating, we are now delaying our release due to bugs that have been introduced in the latest version that we require to fix previously reported bugs! Bugs upon bugs.
I have attached a sample to reproduce the issue using version 19.2.0.47.
The error stack:
Microsoft.AspNetCore.Components.Server.Circuits.RemoteRenderer: Warning: Unhandled exception rendering component: Object reference not set to an instance of an object.
System.NullReferenceException: Object reference not set to an instance of an object.
at Syncfusion.Blazor.Schedule.Internal.ResourceRenderer`2.OnParametersSetAsync()
at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
Microsoft.AspNetCore.Components.Server.Circuits.CircuitHost: Error: Unhandled exception in circuit 'HLVgp1WOeStpmVetxnmfh7b8G74WbWjNKJvdsUH3cMU'.
System.NullReferenceException: Object reference not set to an instance of an object.
at Syncfusion.Blazor.Schedule.Internal.ResourceRenderer`2.OnParametersSetAsync()
at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
[2021-07-15T10:12:35.099Z] Error: System.NullReferenceException: Object reference not set to an instance of an object.
at Syncfusion.Blazor.Schedule.Internal.ResourceRenderer`2.OnParametersSetAsync()
at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
[2021-07-15T10:12:35.100Z] Information: Connection disconnected.
Microsoft.AspNetCore.Components.Server.Circuits.RemoteRenderer: Warning: Unhandled exception rendering component: Object reference not set to an instance of an object.
System.NullReferenceException: Object reference not set to an instance of an object.
at Syncfusion.Blazor.Schedule.Internal.ResourceRenderer`2.OnParametersSetAsync()
at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
Microsoft.AspNetCore.Components.Server.Circuits.CircuitHost: Error: Unhandled exception in circuit 'HLVgp1WOeStpmVetxnmfh7b8G74WbWjNKJvdsUH3cMU'.
System.NullReferenceException: Object reference not set to an instance of an object.
at Syncfusion.Blazor.Schedule.Internal.ResourceRenderer`2.OnParametersSetAsync()
at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
Microsoft.AspNetCore.Components.Server.Circuits.RemoteRenderer: Warning: Unhandled exception rendering component: Encountered unsupported frame type during diffing: None
System.NotImplementedException: Encountered unsupported frame type during diffing: None
at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForFramesWithSameSequence(DiffContext& diffContext, Int32 oldFrameIndex, Int32 newFrameIndex)
at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForRange(DiffContext& diffContext, Int32 oldStartIndex, Int32 oldEndIndexExcl, Int32 newStartIndex, Int32 newEndIndexExcl)
at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForFramesWithSameSequence(DiffContext& diffContext, Int32 oldFrameIndex, Int32 newFrameIndex)
at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForRange(DiffContext& diffContext, Int32 oldStartIndex, Int32 oldEndIndexExcl, Int32 newStartIndex, Int32 newEndIndexExcl)
at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.ComputeDiff(Renderer renderer, RenderBatchBuilder batchBuilder, Int32 componentId, ArrayRange`1 oldTree, ArrayRange`1 newTree)
at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.RenderInExistingBatch(RenderQueueEntry renderQueueEntry)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessRenderQueue()
Microsoft.AspNetCore.Components.Server.Circuits.CircuitHost: Error: Unhandled exception in circuit 'HLVgp1WOeStpmVetxnmfh7b8G74WbWjNKJvdsUH3cMU'.
System.NotImplementedException: Encountered unsupported frame type during diffing: None
at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForFramesWithSameSequence(DiffContext& diffContext, Int32 oldFrameIndex, Int32 newFrameIndex)
at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForRange(DiffContext& diffContext, Int32 oldStartIndex, Int32 oldEndIndexExcl, Int32 newStartIndex, Int32 newEndIndexExcl)
at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForFramesWithSameSequence(DiffContext& diffContext, Int32 oldFrameIndex, Int32 newFrameIndex)
at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForRange(DiffContext& diffContext, Int32 oldStartIndex, Int32 oldEndIndexExcl, Int32 newStartIndex, Int32 newEndIndexExcl)
at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.ComputeDiff(Renderer renderer, RenderBatchBuilder batchBuilder, Int32 componentId, ArrayRange`1 oldTree, ArrayRange`1 newTree)
at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.RenderInExistingBatch(RenderQueueEntry renderQueueEntry)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessRenderQueue()
In addition to the above, if one of the resource lists has additional fields on the bound object that aren't used for the resource grouping and those fields are changed, the exception also gets thrown.
For example, if the UserProjectData class has an int property of SomeExtraId and SomeExtraId is editted, the exception will be thrown upon saving.
SomeExtraId isn't used for grouping by the scheduler, it is merely a populated field on the UserProjectData class.
Updated sample attached with this exact scenario.