Skip to content

fix: de-duplicate custom operations on c8y/devicecontrol/notifications#3744

Merged
jarhodes314 merged 1 commit intothin-edge:mainfrom
jarhodes314:fix/duplicate-custom-operations
Jul 29, 2025
Merged

fix: de-duplicate custom operations on c8y/devicecontrol/notifications#3744
jarhodes314 merged 1 commit intothin-edge:mainfrom
jarhodes314:fix/duplicate-custom-operations

Conversation

@jarhodes314
Copy link
Copy Markdown
Contributor

Proposed changes

Ensure tedge-mapper-c8y doesn't handle incoming custom operations if received multiple times from Cumulocity.

The specific case this fixes is for custom operations from Cumulocity JSON fragements (e.g. on c8y/devicecontrol/notifications) where these execute using a command from the mapper. Since these don't use a workflow to execute, these operations didn't generate any te/... messages, so we didn't track them in active_commands. This PR changes this so that any operation with an ID is included in active_commands, and it will be removed after a 12 hour timeout elapses.

This won't fix any cases where we are using smartrest to receive the operation payload, since those messages do not have an ID included in the payload.

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

Signed-off-by: James Rhodes <jarhodes314@gmail.com>
@codecov
Copy link
Copy Markdown

codecov bot commented Jul 28, 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.

@reubenmiller reubenmiller added the theme:c8y Theme: Cumulocity related topics label Jul 28, 2025
@github-actions
Copy link
Copy Markdown
Contributor

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
666 0 3 666 100 1h50m10.863167999s

Copy link
Copy Markdown
Member

@rina23q rina23q left a comment

Choose a reason for hiding this comment

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

I was trying to think of corner cases by removing the .is_empty() blocks, but nothing came to mind. So I'm fine with approving it.

Copy link
Copy Markdown
Contributor

@albinsuresh albinsuresh left a comment

Choose a reason for hiding this comment

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

LGTM

@jarhodes314 jarhodes314 added this pull request to the merge queue Jul 29, 2025
Merged via the queue into thin-edge:main with commit 8fade01 Jul 29, 2025
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

theme:c8y Theme: Cumulocity related topics

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants