Skip to content

fix: no dynamic connection when deregister does nothing#3697

Merged
albinsuresh merged 1 commit intothin-edge:mainfrom
albinsuresh:imp/no-dynamic-connection-on-deregster-no-op
Jun 24, 2025
Merged

fix: no dynamic connection when deregister does nothing#3697
albinsuresh merged 1 commit intothin-edge:mainfrom
albinsuresh:imp/no-dynamic-connection-on-deregster-no-op

Conversation

@albinsuresh
Copy link
Copy Markdown
Contributor

@albinsuresh albinsuresh commented Jun 20, 2025

Proposed changes

  • Avoid unnecessarily creating any dynamic connections when entity deregister is a no-op.

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Improvement (general improvements like code refactoring that doesn't explicitly fix a bug or add any new functionality)
  • Documentation Update (if none of the other choices apply)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Paste Link to the issue


Checklist

  • I have read the CONTRIBUTING doc
  • I have signed the CLA (in all commits with git commit -s. You can activate automatic signing by running just prepare-dev once)
  • I ran just format as mentioned in CODING_GUIDELINES
  • I used just check as mentioned in CODING_GUIDELINES
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Further comments

@codecov
Copy link
Copy Markdown

codecov bot commented Jun 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jun 20, 2025

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
652 0 3 652 100 1h52m25.398111s

if message.retain && !message.payload_bytes().is_empty() {
if message.retain
&& !message.payload_bytes().is_empty()
&& topics.accept(&message)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can mqtt_connector.connect(topics) returns messages which are not related to the given topics?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Technically no (which is what I was relying on as well). Just added this extra guard to prevent issues like what James encountered, where unexpected subscriptions got added to the connection behind the scenes. So, thought of leaving it there as a defence to prevent some future bug breaking the assumptions made here.

Copy link
Copy Markdown
Contributor

@didier-wenzek didier-wenzek left a comment

Choose a reason for hiding this comment

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

Approved

@albinsuresh albinsuresh added this pull request to the merge queue Jun 23, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jun 23, 2025
@albinsuresh albinsuresh added this pull request to the merge queue Jun 23, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jun 23, 2025
@albinsuresh albinsuresh force-pushed the imp/no-dynamic-connection-on-deregster-no-op branch from 8f7ed5b to e585642 Compare June 24, 2025 05:55
@albinsuresh albinsuresh temporarily deployed to Test Pull Request June 24, 2025 05:55 — with GitHub Actions Inactive
@albinsuresh albinsuresh enabled auto-merge June 24, 2025 05:55
@albinsuresh albinsuresh added this pull request to the merge queue Jun 24, 2025
Merged via the queue into thin-edge:main with commit 3c9cfc0 Jun 24, 2025
34 checks passed
@albinsuresh albinsuresh deleted the imp/no-dynamic-connection-on-deregster-no-op branch July 21, 2025 06:11
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