Skip to content

Fix MQTT v5 topic alias forwarding#2250

Open
suhashollakc wants to merge 1 commit into
dotnet:masterfrom
suhashollakc:suhas/fix-topic-alias-forwarding
Open

Fix MQTT v5 topic alias forwarding#2250
suhashollakc wants to merge 1 commit into
dotnet:masterfrom
suhashollakc:suhas/fix-topic-alias-forwarding

Conversation

@suhashollakc
Copy link
Copy Markdown

Fixes #2199

Summary

This fixes MQTT v5 topic alias handling in the server publish path.

Topic Alias mappings are scoped to a single network connection. When a client publishes a message with a Topic Alias, the server should resolve that alias for the inbound connection, but it should not forward the same Topic Alias to subscribers on separate client connections.

Changes

  • Clears TopicAlias before dispatching a received application message to subscriber sessions.
  • Updates MQTT v5 property forwarding coverage so subscriber messages no longer expect the publisher's alias.
  • Extends the server topic alias test to verify subscribers receive resolved topics without forwarded aliases.

Validation

  • dotnet test --project Source\MQTTnet.Tests\MQTTnet.Tests.csproj --framework net10.0 --filter "Topic_Alias_Tests|Publish_And_Receive_New_Properties" --no-restore
  • dotnet build MQTTnet.sln --no-restore

Note: a full local test run was not clean in this environment due to unrelated TLS credential/runtime/network-sensitive tests.

@suhashollakc
Copy link
Copy Markdown
Author

@dotnet-policy-service agree

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

Successfully merging this pull request may close these issues.

Incorrect handling of Topic Alias?

1 participant