dotnet / aspnetcore

ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
https://asp.net
MIT License
35.4k stars 10k forks source link

InputNumber race condition bug when holding key up to increase the value when internet connection is slow and rendermode is InteractiveServer #53487

Closed 11110011 closed 8 months ago

11110011 commented 9 months ago

Is there an existing issue for this?

Describe the bug

In a Blazor solution with render mode InteractiveServer place an InputNumber component on a page

<InputNumber @bind-Value="currentCount" />

@code {
    private int currentCount = 0;
}

Showing this page in a browser set the cursor into the InputNumber and hold key up to increase the value. Normally this works fine, but if you have a slow internet connection (note: it's easy to reproduce this bug while copying a larger file over your network or having a video call at the same time, so the upload stream is maxed out) after a few seconds the value starts jumping between arbitrary values.

If this happens it is not possible anymore to use other components on the same page (f.e. click on a save button or place cursor to another field) .

Maybe it has something to do with the issue mentioned here: https://github.com/dotnet/aspnetcore/issues/22159

Expected Behavior

The InputNumber component in InteractiveServer mode should behave like when using rendermode InteractiveClient (there the problem does not occur. On InteractiveClient, if the upload stream is at max the InputNumber-Field temporarily stops increasing the value and continues when the needed bytes are sent over your network.)

Steps To Reproduce

No response

Exceptions (if any)

No response

.NET Version

.NET SDK: Version: 8.0.101 Commit: 6eceda187b Workload version: 8.0.100-manifests.9297b15b Laufzeitumgebung: OS Name: Windows OS Version: 10.0.22621 OS Platform: Windows RID: win-x64 Base Path: C:\Program Files\dotnet\sdk\8.0.101\ Installierte .NET-Workloads: Workload version: 8.0.100-manifests.9297b15b [android] Installationsquelle: VS 17.8.34408.163 Manifestversion: 34.0.43/8.0.100 Manifestpfad: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.android\34.0.43\WorkloadManifest.json Installationstyp: Msi [ios] Installationsquelle: VS 17.8.34408.163 Manifestversion: 17.0.8478/8.0.100 Manifestpfad: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.ios\17.0.8478\WorkloadManifest.json Installationstyp: Msi [maui-windows] Installationsquelle: VS 17.8.34408.163 Manifestversion: 8.0.3/8.0.100 Manifestpfad: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.maui\8.0.3\WorkloadManifest.json Installationstyp: Msi [maccatalyst] Installationsquelle: VS 17.8.34408.163 Manifestversion: 17.0.8478/8.0.100 Manifestpfad: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.maccatalyst\17.0.8478\WorkloadManifest.json Installationstyp: Msi Host: Version: 8.0.1 Architecture: x64 Commit: bf5e279d92 .NET SDKs installed: 5.0.413 [C:\Program Files\dotnet\sdk] 8.0.100 [C:\Program Files\dotnet\sdk] 8.0.101 [C:\Program Files\dotnet\sdk] .NET runtimes installed: Microsoft.AspNetCore.App 3.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.26 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 7.0.15 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 8.0.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 3.1.30 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.26 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 7.0.15 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 8.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 3.1.30 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 6.0.10 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 6.0.26 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 7.0.15 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 8.0.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Other architectures found: x86 [C:\Program Files (x86)\dotnet] registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation] Environment variables: Not set global.json file: Not found

Anything else?

Found in Net Core 8.0 but exists in Net Core 7.0 too.

mkArtakMSFT commented 8 months ago

@MackinnonBuck can you please try to repro this and we'll go from there? Thanks!

dotnet-policy-service[bot] commented 8 months ago

Thank you for filing this issue. In order for us to investigate this issue, please provide a minimal repro project that illustrates the problem without unnecessary code. Please share with us in a public GitHub repo because we cannot open ZIP attachments, and don't include any confidential content.

MackinnonBuck commented 8 months ago

Hi @11110011, I wasn't able to reproduce this locally. This initially reminded me of https://github.com/microsoft/fluentui-blazor/issues/304, but the same thing doesn't appear to happen with InputNumber. Could you please provide a repro project that demonstrates the problem, following the instructions of the above comment? Thanks.

dotnet-policy-service[bot] commented 8 months ago

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate.

See our Issue Management Policies for more information.