Skip to content

ITEP-91742: Ensure scene updates always emit DB topic notifications#1420

Merged
sbelhaik merged 11 commits into
sbel/service-standalonefrom
copilot/itep-91742-fix-bug
May 13, 2026
Merged

ITEP-91742: Ensure scene updates always emit DB topic notifications#1420
sbelhaik merged 11 commits into
sbel/service-standalonefrom
copilot/itep-91742-fix-bug

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 11, 2026

📝 Description

Scene update notifications on the DB topic were dropped for update paths with no validated field deltas, causing downstream consumers to miss scene refresh events. This change restores a guaranteed post-commit notification path for those cases.

  • What changed
    • Model: added Scene.notifydbupdate() to enqueue sendUpdateCommand(scene_id=self.pk) on transaction commit.
    • Serializer: in SceneSerializer.create_update, when is_update and validated_data is effectively empty, call instance.notifydbupdate() instead of silently returning.
  • Why it matters
    • Preserves event semantics: scene update intent now emits a DB update message even when no persisted fields change (e.g., metadata-only/update-trigger flows).
if is_update:
  for key, value in validated_data.items():
    setattr(instance, key, value)
  instance.save(send_update_command=send_update_command)
else:
  instance.notifydbupdate()

JIRA: ITEP-91742

✨ Type of Change

Select the type of change your PR introduces:

  • 🐞 Bug fix – Non-breaking change which fixes an issue
  • 🚀 New feature – Non-breaking change which adds functionality
  • 🔨 Refactor – Non-breaking change which refactors the code base
  • 💥 Breaking change – Changes that break existing functionality
  • 📚 Documentation update
  • 🔒 Security update
  • 🧪 Tests
  • 🚂 CI

🧪 Testing Scenarios

Describe how the changes were tested and how reviewers can test them too:

  • ✅ Tested manually
  • 🤖 Ran automated end-to-end tests

✅ Checklist

Before submitting the PR, ensure the following:

  • 🔍 PR title is clear and descriptive
  • 📝 For internal contributors: If applicable, include the JIRA ticket number (e.g., ITEP-123456) in the PR title. Do not include full URLs
  • 💬 I have commented my code, especially in hard-to-understand areas
  • 📄 I have made corresponding changes to the documentation
  • ✅ I have added tests that prove my fix is effective or my feature works

@saratpoluri
Copy link
Copy Markdown
Contributor

@sbelhaik : this test: https://jira.devtools.intel.com/secure/Tests.jspa#/testCase/NEX-T12750
Doesn't explicit cover verifying that the update mqtt messages are triggered. We should either update the test script here or create a separate test case that explicitly verifies this. I have added a functional test to check that scene creation and scene updates trigger the cmd_update and consequently a scene creation results in tracker creation.

@saratpoluri saratpoluri force-pushed the copilot/itep-91742-fix-bug branch from fc5ef51 to 28052c3 Compare May 11, 2026 22:26
Copy link
Copy Markdown
Contributor

@ltalarcz ltalarcz left a comment

Choose a reason for hiding this comment

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

in review

Comment thread controller/tests/tc_database_update_triggers_tracker_creation.py
Copy link
Copy Markdown
Contributor

@ltalarcz ltalarcz left a comment

Choose a reason for hiding this comment

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

Please fix trailing hitespace linter issue:

Trailing whitespace: /home/runner/work/scenescape/scenescape/controller/tests/test_database_update_triggers_tracker_creation.py
Trailing whitespace: /home/runner/work/scenescape/scenescape/manager/tests/tc_scene_creation_sends_update.py

NEX-T10448: FAIL

Comment thread controller/tests/test_database_update_triggers_tracker_creation.py Outdated
@sbelhaik sbelhaik changed the base branch from main to sbel/service-standalone May 13, 2026 09:18
@sbelhaik sbelhaik requested a review from ltalarcz May 13, 2026 09:18
@sbelhaik
Copy link
Copy Markdown
Contributor

Please fix trailing hitespace linter issue:

Trailing whitespace: /home/runner/work/scenescape/scenescape/controller/tests/test_database_update_triggers_tracker_creation.py Trailing whitespace: /home/runner/work/scenescape/scenescape/manager/tests/tc_scene_creation_sends_update.py

NEX-T10448: FAIL

Done.

@sbelhaik sbelhaik merged commit abafcf2 into sbel/service-standalone May 13, 2026
2 checks passed
@sbelhaik sbelhaik deleted the copilot/itep-91742-fix-bug branch May 13, 2026 09:35
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.

4 participants