I'm writing a multi-user, cloud-hosted application using Blazor .Net Core 8 with interactive server-side rendering.
The application uses .Net Events to create an audit trail and my intention was to use them for a notification center as well but since I'm new to working with Events I didn't realize that it wasn't the correct choice for cross-session/multi-user notifications.
One example of a notification would be when a user is editing, for example, a price list and second user starts editing the same price list.
The desired functionality would be for a notification to pop up for both users that they are working on the same price list, as soon as possible after the second user starts editing the price list, without any user interaction required to refresh the UI.
Since Events didn't seem to be the correct approach I took a look at SignalR which seems to be a natural choice for sending notifications to users in different sessions. Microsoft is however very careful to mention that SignalR makes no sense when using server side rendering - the server would basically be talking to itself - and that SignalR should be used with WASM.
I've tried to run just the SignalR notification center component in WASM but that resulted in a number of issues that I couldn't resolve. Although I've read that you can use different rendering modes for individual components it might not be possible in this specific situation.
Before I spend more time on wild goose chases I decided to check with this community to see if there's an established way to achieve the functionality I'm after.
To clarify, the challenge isn't updating the UI when a notification is received, the challenge is sending the notification to one or more users to begin with.
Maybe it's possible to run my notification center component in WASM and I just don't know how. Maybe there is a way to get .Net Events to do what I want. Maybe there's a third option lurking in the shadows that is the correct way to go.
I'm not married to using neither SignalR nor Events, as long as I can get the functionality I'm after - and preferably don't have to write the functionality from scratch - I'm open to suggestions.