Skip to content

Switch to v5 mqtt protocol in commsClient configuration#7603

Merged
Steve-Mcl merged 1 commit into
mainfrom
7602-switch-forge-mqtt-client-to-v5
Jun 24, 2026
Merged

Switch to v5 mqtt protocol in commsClient configuration#7603
Steve-Mcl merged 1 commit into
mainfrom
7602-switch-forge-mqtt-client-to-v5

Conversation

@Steve-Mcl

Copy link
Copy Markdown
Contributor

Description

Updated the MQTT client initialisation in commsClient.js to explicitly set protocolVersion: 5, ensuring the client uses MQTT version 5 for communication.
Amongst other improvements, this gives us:

  • Ability to use correlationData and userProperties for insights (and other future requirements) avoiding the need to embed meta data things like transaction/session ids (that are required for insights) into the payload
  • proper broker-initiated DISCONNECT reason code & reason string (v4 just drops the socket silently - ppoor diagnostics)

Related Issue(s)

Checklist

  • I have read the contribution guidelines
  • Suitable unit/system level tests have been added and they pass
  • Documentation has been updated
    • Upgrade instructions
    • Configuration details
    • Concepts
  • Changes flowforge.yml?
    • Issue/PR raised on FlowFuse/helm to update ConfigMap Template
    • Issue/PR raised on FlowFuse/CloudProject to update values for Staging/Production
  • Link to Changelog Entry PR, or note why one is not needed.

Labels

  • Includes a DB migration? -> add the area:migration label

@Steve-Mcl Steve-Mcl linked an issue Jun 24, 2026 that may be closed by this pull request
@Steve-Mcl

Copy link
Copy Markdown
Contributor Author

@hardillb, if you dont mind, I will tag you as reviewer after I have done some tests on pre-staging.

@codecov

codecov Bot commented Jun 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.95%. Comparing base (2e6ca79) to head (3bf7247).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7603   +/-   ##
=======================================
  Coverage   76.95%   76.95%           
=======================================
  Files         411      411           
  Lines       21094    21094           
  Branches     5141     5141           
=======================================
  Hits        16233    16233           
  Misses       4861     4861           
Flag Coverage Δ
backend 76.95% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Steve-Mcl

Copy link
Copy Markdown
Contributor Author

@hardillb I have tested project nodes, ff-mqtt nodes & device editor/device restart/logs on the pre-staging - all working as expected.

Ready for review.

@Steve-Mcl Steve-Mcl requested a review from hardillb June 24, 2026 12:13
@hardillb

Copy link
Copy Markdown
Contributor

@hardillb I have tested project nodes, ff-mqtt nodes & device editor/device restart/logs on the pre-staging - all working as expected.

Why would changing which MQTT sub protocol version the Forge app UI connects to the broker impact the ff-mqtt nodes, project-nodes? They never talk to each other?

@Steve-Mcl

Copy link
Copy Markdown
Contributor Author

@hardillb I have tested project nodes, ff-mqtt nodes & device editor/device restart/logs on the pre-staging - all working as expected.

Why would changing which MQTT sub protocol version the Forge app UI connects to the broker impact the ff-mqtt nodes, project-nodes? They never talk to each other?

Fair point, i didnt dig down to which of client connections are involved in which messages paths - for the sake of time, I just checked everything I know touches MQTT across the platform.

@Steve-Mcl

Copy link
Copy Markdown
Contributor Author

@hardillb to be clear, this connection is not ui - it is the forge app client connection (so logs, platform status/sync and device comms) are handled by this one.

@hardillb

Copy link
Copy Markdown
Contributor

@Steve-Mcl OK, the forge app shouldn't care either

@Steve-Mcl

Steve-Mcl commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

@Steve-Mcl OK, the forge app shouldn't care either

Indeed! 👍

And as overcheck (for my piece of mind) I did lots of local + pre-staging testing

@Steve-Mcl Steve-Mcl merged commit 858ebac into main Jun 24, 2026
29 checks passed
@Steve-Mcl Steve-Mcl deleted the 7602-switch-forge-mqtt-client-to-v5 branch June 24, 2026 13:44
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.

Switch forge MQTT client to v5

3 participants