-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Consider changing or adding to the MessagePackProtocol options #18569
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
hello @BrennanConroy i can't seem to find your comment here or in my mail or on I suppose it was pointing on this : aspnetcore/src/SignalR/server/SignalR/test/HubConnectionHandlerTests.cs Lines 2363 to 2400 in 7def102
|
So after trying to understand what could be the various ideas, i'm not sure what/how to change ^^ If i describe what i understand from the "code flow" :
This transition from "Multiple" to a "Single" is done in a call to
The Questions :
There's probably other things / way i did not though about ^^ |
would love @AArnott point of view here, as you probably have a way better insight than me here |
Exposing Does aspnetcore require any resolvers to be included in the list, for its own types? If not, then exposing |
I forgot to mention that by default the resolvers are :
|
We don't let users customize how the signalr framing is handled, the options are only for their types. So we don't need to set anything on top of the custom settings they provide.
Yes, that would be the ideal situation. It is slightly inconvenient that we currently provide a list as our options, but maybe we can mark it obsolete and provide the new options type. |
@BrennanConroy Does your code ever call into the I'm curious about how signalr framing relates to the customer types that those frames may carry, as that can impact what you do with their |
Customers types go through the serializer, our framing goes through the reader/writer. Arbitrary example using json since it's readable {
"signalrstuff":"blah",
"arguments": [ "this", "is", "user", "stuff" ], // they only impact what is inside this array
"moreSignalR": "stuff"
} |
remember this morning PR ? (Just forget the RED THINGS, just the code) |
OK, sounds good. |
@BrennanConroy ============== Problem 1 : No parameter less ctor => no Optionsi just made an attempt and out of the box it's not possible since Problem 2 : Immutable Options does not seems to be Option compliantAlso even if there was a
This issue here is that i supposed in fact i would have to do something like :
But that won't work since the "refType" being registered in the DI would be the one instanciated by the first call to |
@AArnott do you know any alternatives to the preview points ? |
I'm not too familiar with ASP.NET Core or SignalR's typical patterns here.
|
ok so we end up with the same 2 possible designs ;) |
If you were hoping I'd recommend one, I appreciate the opportunity, but I just don't know your API design and what customers expect enough to feel I have a well informed opinion. |
i just wanted to be sure i did not missed other possible design :) (edit : that was confusing) |
I'm not sure I see the correlation. SignalR doesn't use StreamJsonRpc, does it? Just FYI, that is an NRE thrown from another process, and JSON-RPC is just the messenger, bringing it back in-proc and informing VS that a failure occurred somewhere else. |
Visual Studio does use it i guess, and it crashed while opening signalr repo when i tried to work on this issue ;) |
As of today, the code ALWAYS does this : So if we open
|
No warning is produced when using the default I assume you have customers that build web apps for intranets, or for authenticated users where the trust level is higher. There are some small perf gains to be had from using UntrustedData, and some functionality is more likely to work by default (like serializing dictionaries where the key isn't known to be collision resistant). So yes, I think you should allow customers to use TrustedData. But to help users be on the safe path by default, what you might do is add a |
Current design + Default value in
Constructor of
If a customer want to change it i suppose they would just do : Either :
Or :
The only "weird" thing i see is that it would basically do this :
can it have any undesirable impact on message pack side ? (the |
In MessagePack-CSharp v2 there is a
MessagePackSerializerOptions
class that can be passed to the serializer. Currently we expose a list ofIFormatterResolver
s for the user to configure, but there are other options like compression andIMessagePackFormatter
that we don't expose.Options: https://github.com/neuecc/MessagePack-CSharp/blob/8eeb7b8ab71ff7d70f8b2013589423eadbba90b7/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/MessagePackSerializerOptions.cs#L15
Discussion: #18133 (comment)
The text was updated successfully, but these errors were encountered: