YaronAmar-4092 avatar image
0 Votes"
YaronAmar-4092 asked QingGuo-MSFT commented

Blazor Server - How to handle situation when user is faster then SignalR?

I have a complex Blazor server app and I run into situations that user interact with the form and while the server is trying to manipulate the DOM via SignalR, the user manage to do other things in the form. When I debug the app or using PC in the LAN, it works fine because it is very fast. But when I browse from cell phone it is noticeable.

One of those situations is reading a barcode using barcode reader. The flow is:

user scan barcode into textbox
the barcode is validated
if OK or Bad the user gets a message and the textbox is cleared
What happen is that the user is able to scan other barcode before any render is being done to its DOM.

Any solutions ideas would be appreciated

Tx Yaron

· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@YaronAmar-4092 According to the normal operation process, when you are waiting for the result of the scan after scanning, you cannot continue other operations, please check your code .

0 Votes 0 ·

Basically you are right, but that is exactly my problem using Blazor Server app.
Let say I wand to disable the input field or put some spin overlay while waiting for the result.
The user manage to type in the input field before Blazor Server disables the input field or adds spin layout to the user DOM.

0 Votes 0 ·

@YaronAmar-4092 If you added a minimal reproducible example, it would be easier to tell. I'm not sure, at this stage.

1 Vote 1 ·

0 Answers