Extract shared MQTT client core - #738
Open
hjianbo wants to merge 1 commit into
Open
Conversation
hjianbo
force-pushed
the
refactor/issue-699-lifecycle-contract
branch
from
July 31, 2026 12:13
018dbb7 to
98ada77
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
MQTTClientCoreused by both MQTT 3.1.1 and MQTT 5Why
The MQTT 3.1.1 and MQTT 5 facades had independently evolved copies of the same connection lifecycle. That made fixes easy to apply to only one protocol version. This change establishes one implementation for the shared runtime while leaving protocol semantics explicit in each facade.
Fixes #699
Compatibility
$connStateprojected valueCocoaMQTTSocketDelegateconformancedelegateQueueping(), reconnect callback ordering, custom socket event-loop normalization, and deinit behavior are preservedVerification
swift test --filter ConnectionStateContractTestsswift test --filter 'SendingMessageLifecycleTests|CocoaMQTTDeliverTests|ConnectionStateContractTests'— 64 passedswift build --target CocoaMQTT -Xswiftc -swift-version -Xswiftc 6xcodebuild -project CocoaMQTT.xcodeproj -scheme "Mac Framework" -derivedDataPath /private/tmp/CocoaMQTT-699-derived CODE_SIGNING_ALLOWED=NO buildTools/lint.shgit diff --checkmaster— no API differencesThe 307-test local non-broker run reaches only the pre-existing TLS/WSS loopback fixture failures (14 assertion failures), reproduced identically on an untouched
masterworktree; all other tests pass. CI provides the configured loopback environment.