-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Closed
Labels
Milestone
Description
Consider the following code-snippet:
this.StateHasChanged(); // [1]
this.Logger.Debug("after StateHasChanged()"); // [2]
// [2/3]
using (var fileReaderStream = await fileRef.OpenReadAsync()) // [3] JS-Interop is behind this call
{ ... }
Running the code in this order (first StateHasChanged() then something with JS-Interop) causes Blazor Server to deadlock pretty often.
Looking at the log-output, the order is different than the code.
If Task.Delay(2000) is added at position [2/3], everything is fine.
(sorry for the vague description, but it's really hard to get grip on this issue and to explain it precisely)
[2] [11:54:16 DBG] after StateHasChanged() - OnFileSelectedAsync @ Uploader.razor:249
[1] [11:54:16 DBG] Received hub invocation: InvocationMessage { InvocationId: "", Target: "OnRenderCompleted", Arguments: [ 5, ], StreamIds: [ ] }.
[11:54:16 DBG] Received confirmation for batch 5.
[11:54:16 DBG] Completing batch 5 without error.
[3] [11:54:16 DBG] Received hub invocation: InvocationMessage { InvocationId: "", Target: "BeginInvokeDotNetFromJS",
Is this a known problem (maybe related to #9901 ) / already filed issue?