Skip to content

Server Side Blazor (Without Websocket) App crash bug #9875

@chrdlx

Description

@chrdlx

Using the default Server Side Blazor, with Preview 4 I've found that after clicking several times on the Application's navigation menues suddendly the app stopped working showing in the console:

Capture

After trying to duplicate this for some time I've found it's pretty random (some times taking hundreds of clicks to reproduce) so I ended up with this code, that makes the app break pretty fast:

@page "/"

@counter

@functions
{
    int counter = 0;

    protected override async Task OnAfterRenderAsync()
    {
        while (true)
        {
            counter++;
            await Task.Delay(50);
            StateHasChanged();
        }

        base.OnAfterRenderAsync();
    }
}

Just put this code in the Index page, and let it run.... it should break before the counter hits 500...
Remember that this ONLY happens with Websocket disabled, for this I had to publish it in my IIS, and websocket support disabled, using Windows 10. This was reproduced in three different computers.

Please note that this happens in application's real usage too, sometimes a couple of fast clicks triggers the bug. You don't have to use this extreme statehaschange refresh rate to trigger it.

Regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions