You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
AssetsFacade.dispatch rejects batches with multiple events for the same asset #3476
AssetsFacade.dispatch(AttributeEvent... events) rejects valid batches containing multiple events for the same asset. This is a functional bug discovered during the rules-facade scoping audit (#2675).
The facade collects one asset ID per event, queries accessible assets, and compares the number of supplied IDs with the number of assets returned. Repeated IDs only match one database row, so a valid batch is rejected with an access warning and no events are dispatched.
Reproduction
From a Groovy rule, dispatch two updates to different attributes of the same existing asset within the engine's scope (replace the ID and attributes with valid ones):
The validation compares two event IDs with one matching asset and rejects both updates. The same problem affects batches mixing repeated and distinct asset targets.
Expected behavior
Validate the distinct target asset IDs against the engine scope, then forward every original event in its supplied order. If any target is missing or outside the scope, reject the entire call before forwarding any events.
This preserves the existing global, realm and asset-subtree access rules. Event processing remains asynchronous; batch dispatch does not promise transactional attribute updates.
Acceptance Criteria
Add a failing regression test before implementing the fix: two events for different attributes of one permitted asset must both be forwarded.
Cover a valid batch containing both repeated and distinct target asset IDs, preserving every event and its dispatch order.
Cover global, realm and asset-scoped engines.
Confirm that a batch containing a missing or out-of-scope target forwards no events, including when other target IDs are repeated.
Deduplicate only the asset IDs used for validation, not the events dispatched.
Groovy rules can call this batch overload directly. JSON rule actions currently dispatch individual events, so they do not normally encounter this defect.
Activity