Skip to content

Fix batch dispatch of multiple attribute events to the same asset - #3477

Open
ebariaux wants to merge 3 commits into
mainfrom
bugfix/assets-dispatch-batch
Open

ebariaux wants to merge 3 commits into
mainfrom
bugfix/assets-dispatch-batch

Conversation

@ebariaux

Copy link
Copy Markdown
Contributor

Description

Fixes #3476.

AssetsFacade.dispatch rejected valid batches containing multiple attribute events for the same asset because it compared the event count with the number of matching assets. Validate distinct target asset IDs so these batches are accepted, while forwarding every original event in its supplied order.

Retain the existing scope checks and reject the whole batch if the scoped lookup does not return every target. Unit tests cover repeated and distinct targets across global, realm and asset scopes, plus partial lookup results representing missing or out-of-scope targets. Enable the standard manager/src/test/groovy directory alongside the existing test directory.

Validation: ./gradlew --offline --no-daemon :manager:test --tests org.openremote.manager.rules.facade.AssetsFacadeTest — 24 tests passed. The initial regression cases were confirmed failing before the fix.

No breaking API changes; this restores valid batch dispatch behavior.

Checklist

  • 1. Acceptance criteria of the linked issue(s) are met
  • 2. Tests are written and all tests pass (targeted suite: 24 tests)
  • 3. Changes are manually tested by you and the reviewer
  • 4. Documentation is written or updated (not required for this bugfix)

@ebariaux ebariaux added the Bug Error or issue in the system label Oct 23, 2026
@ebariaux ebariaux self-assigned this Oct 23, 2026
@ebariaux
ebariaux requested a review from a team October 23, 2026 14:25
@sonarqubecloud

Copy link
Copy Markdown

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Error or issue in the system

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AssetsFacade.dispatch rejects batches with multiple events for the same asset

1 participant