Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: resubscribe when no session present (#895) #1650

Merged
merged 2 commits into from
Jul 28, 2023

Conversation

simonnilsson
Copy link
Contributor

@simonnilsson simonnilsson commented Jul 26, 2023

The combination clean=false, resubscribe=true, sessionPresent=false should now trigger a resubscribe for MQTT v3.1.1, not only for v5.

Closes #895
Closes #1288

@@ -2106,7 +2106,7 @@ export default class MqttClient extends TypedEventEmitter<MqttClientEventCallbac
if (
!this._firstConnection &&
(this.options.clean ||
(this.options.protocolVersion === 5 &&
Copy link
Member

Choose a reason for hiding this comment

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

Could you add a comment here with the links to MQTT 3.1.1 specs that explain this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@codecov
Copy link

codecov bot commented Jul 27, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (18bdd49) 81.11% compared to head (b5837dc) 81.11%.

❗ Current head b5837dc differs from pull request most recent head c2434e3. Consider uploading reports for the commit c2434e3 to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1650   +/-   ##
=======================================
  Coverage   81.11%   81.11%           
=======================================
  Files          21       21           
  Lines        1366     1366           
  Branches      324      324           
=======================================
  Hits         1108     1108           
  Misses        181      181           
  Partials       77       77           
Files Changed Coverage Δ
src/lib/client.ts 85.81% <ø> (ø)

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

@robertsLando robertsLando enabled auto-merge (squash) July 28, 2023 12:57
@robertsLando robertsLando merged commit 37acda6 into mqttjs:main Jul 28, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants