-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Update MessagePack version #47790
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
Update MessagePack version #47790
Conversation
@@ -79,8 +79,12 @@ private HubMessage CreateInvocationMessage(ref MessagePackReader reader, IInvoca | |||
} | |||
|
|||
var target = ReadString(ref reader, binder, "target"); | |||
if (string.IsNullOrEmpty(target)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a bug fix?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really, it would have thrown later at the binder.GetParameterTypes(target)
call, which would result in slightly different exception behavior. This just provides a more accurate exception message.
@@ -79,8 +79,12 @@ private HubMessage CreateInvocationMessage(ref MessagePackReader reader, IInvoca | |||
} | |||
|
|||
var target = ReadString(ref reader, binder, "target"); | |||
if (string.IsNullOrEmpty(target)) | |||
{ | |||
throw new InvalidDataException("Null or empty target for Invocation message."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be useful to indicate whether it was null or empty? Also, is empty actually possible or will it always end up null if it's missing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both should be possible (I explicitly added empty string tests for all these new exceptions). And when I say should, it's only possible if someone manually tries to implement the protocol and gets it wrong. Which is why I don't think it's important to distinguish between them.
Closes #46787
The update included nullable annotations in the msgpack library.