Skip to content
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

[Discussion] ASP.NET Core SignalR MessagePack Hub Protocol moving to MessagePack v2.x package #18692

Closed
analogrelay opened this issue Jan 30, 2020 · 6 comments
Labels
area-signalr Includes: SignalR clients and servers
Milestone

Comments

@analogrelay
Copy link
Contributor

analogrelay commented Jan 30, 2020

ASP.NET Core SignalR MessagePack Hub Protocol moving to MessagePack v2.x package

The ASP.NET Core SignalR MessagePack Hub Protocol uses the MessagePack NuGet package for MessagePack serialization. In ASP.NET Core 5.0, we will move from the 1.x version to the latest 2.x version. This is a breaking change for:

  • Anyone who is setting/configuring values on MessagePackHubProtocolOptions
  • Anyone who was using the MessagePack APIs directly and using the ASP.NET Core SignalR MessagePack Hub Protocol in the same application, as the newer version will be loaded instead of the previous version.

Version introduced

5.0-preview1

Old behavior

Previously, ASP.NET Core SignalR used the MessagePack 1.x package to serialize/deserialize MessagePack messages.

New behavior

Now, ASP.NET Core SignalR will use the MessagePack 2.x package to serialize/deserialize MessagePack messages.

Reason for change

We believe updating to MessagePack v2.x will add useful new functionality and allow us to stay current with the latest improvements in that package.

The new behavior will impact some aspects of message serialization and deserialization. See the guidance for migrating from 1.x to 2.x published by the MessagePack package authors. Specifically, there are behavioral changes to how DateTime values are serialized.

Recommended action

If you are using MessagePack directly in your application and using the SignalR MessagePack Hub Protocol, update your usage to adapt to any breaking changes in the 2.x release of MessagePack. The MessagePack package authors have published guidance for migrating from 1.x to 2.x.

Category

ASP.NET

Affected APIs

This is the discussion issue for the following announcement: aspnet/Announcements#404


Issue metadata

  • Issue type: breaking-change
@analogrelay
Copy link
Contributor Author

Special thanks to @tebeco for contributing this change!

@tebeco
Copy link
Contributor

tebeco commented Jan 30, 2020

(and @AArnott / @BrennanConroy for their advice and patience)

@ChaosEngine
Copy link

So for current LTS dotnet 3.1 we are bound to MessagePack 1.x family only, right? MessagePack 2.x is not compatible/supported until dotnet 5.x?
So we should stop updating nuget package to >=2.x

@tebeco
Copy link
Contributor

tebeco commented Feb 4, 2020

yes for SignalR 3.x, you cannot update to MessagePack 2.x
this is true ONLY if you use the MessagePackHubProtocol
for example if you only use the JsonHubProtocol you do whatever you want as MessagePack is a transitive if a specific nuget that is not referenced by default IIRC

so i would not say

So we should stop updating nuget package to >=2.x

I would rather say something like:
Until aspnetcore 5.x is release AND you need the MessagePackHubProtocol then you need to set an explicit constraints on MessagePack so that it is strictly inferior to 2.0.0
Version="[1.7.*, 2.0.0)"
that way you are still using a "declarative mode stating what you want" and on top of it you will get explicit dotnet restore error if another third part tries to pull a superior version

@analogrelay
Copy link
Contributor Author

@ChaosEngine Unfortunately yes, because of the breaking nature of the upgrade. The 3.1 LTS will continue to be on MessagePack 1.x.

We have a good relationship with the authors of that package though, and expect to be able to continue patching critical issues in the MessagePack 1.x series of packages for the duration of the LTS. However, as is always the case when using non-Microsoft components like MessagePack, that isn't something we can guarantee (which is also why the MessagePack Hub protocol ships in a separate NuGet package rather than in the core Framework).

@ghost
Copy link

ghost commented Dec 2, 2020

Thank you for contacting us. Due to a lack of activity on this discussion issue we're closing it in an effort to keep our backlog clean. If you believe there is a concern related to the ASP.NET Core framework, which hasn't been addressed yet, please file a new issue.

This issue will be locked after 30 more days of inactivity. If you still wish to discuss this subject after then, please create a new issue!

@ghost ghost closed this as completed Dec 2, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Jan 1, 2021
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-signalr Includes: SignalR clients and servers
Projects
None yet
Development

No branches or pull requests

4 participants