Skip to content

Conversation

@fpseverino
Copy link
Collaborator

  • Bump swift-tools-version to 6.2
  • Enable Swift 6 language mode and "NonisolatedNonsendingByDefault"
  • Remove unused ping/pong code from WebSocketHandler that was causing warnings

There is a warning left in MQTTChannelHandler that right now I don't know how to solve and a few left in MQTTConnection that require a bit of restructuring (will do in a separate PR)

Resolves #188

@codecov
Copy link

codecov bot commented Jan 16, 2026

Codecov Report

❌ Patch coverage is 94.73684% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 84.74%. Comparing base (8bde835) to head (74dca62).

Files with missing lines Patch % Lines
...s/MQTTNIO/ChannelHandlers/MQTTChannelHandler.swift 91.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##               v3     #195      +/-   ##
==========================================
+ Coverage   83.80%   84.74%   +0.94%     
==========================================
  Files          28       28              
  Lines        3093     3061      -32     
==========================================
+ Hits         2592     2594       +2     
+ Misses        501      467      -34     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

// now we have received the PUBREL we can process the published message. PUBCOMP is sent by `respondToPubrel`
return true
}
.map { _ in publish }
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line throws the warning Reference to captured var 'publish' in concurrently-executing code.
How can we get the publishMessage out of the sendMessage's checkInbound closure?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Urghh that's a horrid bit of code. That's not an easy one to resolve

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not totally sure what I'm doing there. It looks like I'm trying to deal with a PUBLISH being sent twice and resetting the PUBREC/PUBREL handshake. I don't think it even works. Perhaps comment out the mutable publish and the setting of publish if we receive a publish packet add a big comment to investigate and also add an issue here to check it out.

Copy link
Collaborator

@adam-fowler adam-fowler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a number of places where assumeIsolated() can be used instead of NIOLoopBound. It's easier to use and looks cleaner.

Also there are still two warnings about mutable types in MQTTConnection.connect, but I'd prefer you leave them as my NIOAsyncTestingChannel PR touches that function and I can fix in that PR to make the merge easier

@fpseverino
Copy link
Collaborator Author

fpseverino commented Jan 16, 2026

Also there are still two warnings about mutable types in MQTTConnection.connect, but I'd prefer you leave them as my NIOAsyncTestingChannel PR touches that function and I can fix in that PR to make the merge easier

Yeah, they are due to the fact that we mutate the configuration and the cleanSession setting.

I'm studying clean sessions from the MQTT specification because I think we're doing something wrong at the moment (we could also move cleanSession and identifier inside MQTTConnectionConfiguration, WDYT?).

The mutation of configuration is because we have different settings for keepAliveInterval and pingInterval, what do you think if we merge the two into a single property (in a future PR)?

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.

2 participants