Open kentcb opened 3 years ago
Hi @kentcb,
There are a lot of hoops to jump through to force everything to be type safe with how hubs are constructed. Due to how SignalR works I have to return a specific type based on the features the user opts into. I'm able to ensure this type of thing can't happen with Saturn since I'm able to apply both AddSignalR
and UseSignalR
during the build method of the CE.
I'm not sure if it's possible for me to add a check to give a better experience when this does happen, I'll have to circle back and do some investigating.
Description
One must be sure to invoke the same
AddSignalR
andUseSignalR
overloads, otherwise confusing dependency resolution errors occur. For example, if one invokes:The following runtime error occurs when attempting to connect to the hub:
Steps to reproduce
AddSignalR
andUseSignalR
overloads, which causes a mismatch between types registered and types requested during resolutionExpected behavior
At minimum, it would be nice to have a good runtime error message guide the dev here. But I'm also not sure why the split between send/invoke and streaming exists. If
Settings
had streaming-related properties in it too, there would be no need for multiple overloads and hence no chance of mismatching calls.