Open He-Wu opened 5 months ago
That seems very very unlikely, an unhandled exception means that Blazor is being put into an invalid error state. Blazor Server will disconnect the circuiit, and likewise BlazorWebAssembly, both will be in an invalid state, where the app needs to recover, tipically by refreshing the page/ reloading the app.
So you might have some custom global error handling logic somewhere that wakes the app back up somehow, and your component is just straight up being reloaded, and that's why ReadData gets called again.
So the code you have provided does not allow to reproduce this issue, as a standard blazor app will be in an invalid state since an exception was thrown and not handled.
Hello @He-Wu, thank you for your submission. The issue was labeled "Status: Repro Missing", as you have not provided a way to reproduce the issue quickly. Most problems already solve themselves when isolated, but we would like you to provide us with a reproducible code to make it easier to investigate a possible bug.
Blazorise Version
1.2.3
What Blazorise provider are you running on?
Bootstrap5
Link to minimal reproduction or a simple code snippet
Steps to reproduce
When using the ReadData method of the datagrid component to simulate reading data from the database, if any error is triggered on the page (for example, clicking the button to throw an exception in the example code), the ReadData method is executed once. This results in an additional database query. I merely threw an exception, and it inexplicably executed a query, which seems very strange. I think it shouldn't execute a query when an exception is triggered.
What is expected?
When an exception is thrown, the ReadData method should not be executed.
What is actually happening?
1
What browsers do you see the problem on?
Chrome
Any additional comments?
No response