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

Dependency MQTTnet out of date and has breaking changes. #269

Open
Clockwork-Muse opened this issue Oct 4, 2023 · 5 comments
Open

Dependency MQTTnet out of date and has breaking changes. #269

Clockwork-Muse opened this issue Oct 4, 2023 · 5 comments
Assignees

Comments

@Clockwork-Muse
Copy link

The dependency for MQTTnet is now at version 4.3.1.873, which includes some breaking changes (or at least some binary incompatibilities).

Attempting a project like so:

<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">

  <PropertyGroup>
    <TargetFramework>net6.0</TargetFramework>
    <Nullable>enable</Nullable>
    <ImplicitUsings>enable</ImplicitUsings>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="CloudNative.CloudEvents" Version="2.7.1" />
    <PackageReference Include="CloudNative.CloudEvents.Mqtt" Version="2.7.1" />
    <PackageReference Include="CloudNative.CloudEvents.SystemTextJson" Version="2.7.1" />
    <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="6.0.18" />
    <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="6.0.18" PrivateAssets="all" />
    <PackageReference Include="MQTTnet" Version="3.1.2" />
  </ItemGroup>

</Project>

... ends up yielding

dotnet build
MSBuild version 17.3.2+561848881 for .NET
  Determining projects to restore...
  All projects are up-to-date for restore.
/workspaces/event-client/Pages/FetchData.razor(64,30): error CS0012: The type 'MqttApplicationMessage' is defined in an assembly that is not referenced. You must add a reference to assembly 'MQTTnet, Version=3.0.15.0, Culture=neutral, PublicKeyToken=b69712f52770c0a7'. [/workspaces/event-client/event-client.csproj]
/workspaces/event-client/Pages/FetchData.razor(65,37): warning CS8602: Dereference of a possibly null reference. [/workspaces/event-client/event-client.csproj]
/workspaces/event-client/Pages/FetchData.razor(65,26): warning CS8604: Possible null reference argument for parameter 'item' in 'void List<string>.Add(string item)'. [/workspaces/event-client/event-client.csproj]

Build FAILED.

/workspaces/event-client/Pages/FetchData.razor(65,37): warning CS8602: Dereference of a possibly null reference. [/workspaces/event-client/event-client.csproj]
/workspaces/event-client/Pages/FetchData.razor(65,26): warning CS8604: Possible null reference argument for parameter 'item' in 'void List<string>.Add(string item)'. [/workspaces/event-client/event-client.csproj]
/workspaces/event-client/Pages/FetchData.razor(64,30): error CS0012: The type 'MqttApplicationMessage' is defined in an assembly that is not referenced. You must add a reference to assembly 'MQTTnet, Version=3.0.15.0, Culture=neutral, PublicKeyToken=b69712f52770c0a7'. [/workspaces/event-client/event-client.csproj]
    2 Warning(s)
    1 Error(s)

Time Elapsed 00:00:00.73
@jskeet
Copy link
Contributor

jskeet commented Oct 5, 2023

Thanks - we'll need to have a think about what to do here. We'd need a new major version (at least for the MQTT package) if we just bump the dependency - and at that point, anyone still using v3 would have problems.

I wonder whether the right approach is to create a new package, CloudNative.CloudEvents.Mqtt4. What do you think?

@jskeet jskeet self-assigned this Oct 5, 2023
@Clockwork-Muse
Copy link
Author

On a personal level I get annoyed with versioning in the package/namespace name. I understand why people sometimes do it though.

@jskeet
Copy link
Contributor

jskeet commented Oct 5, 2023

On a personal level I get annoyed with versioning in the package/namespace name. I understand why people sometimes do it though.

So what would your proposal be as an alternative? How would you suggest we support v3 users and v4 users? Or just not support v3 users any more?

@Clockwork-Muse
Copy link
Author

Take the breaking change, drop v3 support (which hasn't been updated in > 18 mos).
If v3 support is still needed for some reason, release/maintenance branch.

@jskeet
Copy link
Contributor

jskeet commented Oct 5, 2023

Right. And presumably release this as a new major version of just the MQTT CE package. (We don't want to disrupt other users, but we do want to signal the breaking change to MQTT users.) This is something I've thought we'll probably end up needing for a while - this is just the forcing function. I think "release everything all at the same time" is probably still appropriate, and we can keep a common minor/patch version, but vary major version by package...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants