Observe packet task failures to prevent unobserved overflow exceptions
Server dispatch and session enqueue operations create packet bus items without
waiting for delivery. When the pending-message queue overflows, Fail faults
the item's completion task, which can later raise UnobservedTaskException
even if the application handles the dropped-message notification.
Observe the completion task's exception inside MqttPacketBusItem.Fail. This
keeps the task faulted and preserves the original exception for existing and
future WaitAsync callers, including DeliverApplicationMessageAsync.
Add a garbage-collection regression test for failures without a waiter and
verify that requesting the task before or after failure preserves the original
overflow exception. Re-enable unobserved-exception tracking in the existing
overflow integration tests for both drop strategies.
Before the fix, the focused run failed the new unobserved-exception test and
both enqueue overflow tests. After the fix, all nine focused cases and all
489 tests in the .NET 10 Release test suite pass.
Fixes https://github.com/dotnet/MQTTnet/issues/2271
* Add support for binary user properties in MQTT 5.0
* Optimize byte array reversal in SubscriptionTopicHashTests
* Use InvariantCulture for topic string conversion in Load_Tests
* switched to `Microsoft.Testing.Platform`
* Refactor CI workflow to separate signed and unsigned package builds
* Add condition to sign job to prevent execution on external pull requests
* Remove fallback to value as string in MqttUserProperty
* Refactor MqttUserProperty handling to use byte arrays for improved performance and add deprecation warnings for legacy methods
* Add Directory.Build.props.
* Adjust Analysis related properties and add conditional enablement for ContinuousIntegrationBuild.
* Adopt new changes in master
---------
Co-authored-by: christian <6939810+chkr1011@users.noreply.github.com>
* Make use of language features line AsyncDispose, init etc.
* Fix build errors
* Improve Unit Tests
* Improve Unit Tests
* Improve Unit Tests
* Update samples
* Remove obsolete benchmarks
* Code cleanup
* Improve unit tests
* Improve Unit Tests
* Fix Unit Tests
* Improve Unit Tests
* Improve Unit Tests
* Restore unit tests
* Exclude load tests from unit tests
* Improve session message injection methods
* Add more tests for session injection
* Change return type from MqttPublishPacket to MqttPacketWithIdentifier
* Use dedicated type for MattApplicationMessage injection result
* Code review minor fixes
* Apply project code style
* Update release notes
---------
Co-authored-by: Anton Smolkov <anton.smolkov@idp.zyfra.com>
Co-authored-by: christian <6939810+chkr1011@users.noreply.github.com>
* Add support for changing the protocol type on socket level
* Do not set NoDelay when not supported by protocol
* Update release notes
* Fix release notes
* Access exception so that it will not treated as unhandled
* Refactor code
* Improve unit tests
* Fix null reference exception
* Update ReleaseNotes.md
* Refactor Unit Tests
* Add new certificate provider interface instead of read only certificates list.
* Update ReleaseNotes.md
* Fix Unit Tests
* Fix build
* unit testing hot swappable certificates (#1787)
* Move test classes to correct namespace
* Apply code style
---------
Co-authored-by: Sean Hanna <hannasm@users.noreply.github.com>
* Return task with NULL result instead of NULL
* move Task.FromResult call out of lock
* Update ReleaseNotes.md
---------
Co-authored-by: Christian <6939810+chkr1011@users.noreply.github.com>
* Moved the usage of certificate provider into the server listener so that each connection has the posibility of receiving a new SSL cert.
* Removed warning from unused field.
* Reduced changeds on original codebase.
---------
Co-authored-by: Jeff Scherrer <Jeff.Scherrer@vw.com>