MatBlazor
MatBlazor copied to clipboard
Toast thread safety
Hi,
I have a web app (blazor) that is connected to a server via signalr. The web app has a scoped IMatToaster service.
When the app receives two notifications in very quick succession it throws an exception. If I place a lock around the Toast call, the exception goes away. Should IMatToaster be thread safe?
Thanks.
Update: I get lots of Index out of bounds type exceptions when I have multiple simultaneous toasts. If I disable all but one of the notifications (without any other changes to my code), the issue goes away.
Second Update: please see the screen grab below

From a user's perspective IMatToaster definitely should be thread safe. Looking at the current implementation you can see it isn't at all. I would grab this issue if I'm allowed to ✌
Hi MatBlazor people. Are you reading these threads? @chris579 identified that my hunch was right about thread safety, but I haven't heard from you here for 3 weeks. Is MatBlazor not supported?
Thanks, Simon
Having the same problem when there are multiple toasts on screen, ArgumentOutOfRangeException happens time to time and crashes everything. I'll just have to remove toasts if this doesn't get fixed soon.
From a user's perspective
IMatToasterdefinitely should be thread safe. Looking at the current implementation you can see it isn't at all. I would grab this issue if I'm allowed to ✌
Found thread safe implementation. Just need to be copied here