Skip to content

Prevent rules asset queries from retaining scope restrictions across executions - #3481

Open
ebariaux wants to merge 2 commits into
mainfrom
bugfix/assets-query-isolation
Open

ebariaux wants to merge 2 commits into
mainfrom
bugfix/assets-query-isolation

Conversation

@ebariaux

Copy link
Copy Markdown
Contributor

Description

Fixes #3478. Part of #2819.

AssetsFacade.getResults modified caller-owned queries when applying engine scope and storage defaults. Reusing an asset-scoped query through a realm or global engine could retain the earlier asset-path restriction. Each execution now uses an independent AssetQuery copy, preserving the caller's filters and preventing later caller edits from changing an earlier execution's query.

Add a copy constructor and copying support for nested logical groups, attribute predicates, metadata, paths and mutable values. Preserve null versus empty selections, numeric precision and predicate types. Built-in value predicates are copied explicitly; custom serializable predicates use Java serialization. The facade applies its projection to the copy, so it no longer needs to restore the caller's projection afterwards.

Regression tests cover query reuse across global, realm and asset engines, storage-added defaults, nested mutation isolation, empty selections and predicate copying. Enable manager/src/test/groovy alongside the existing test directory. Path-filter preservation remains tracked separately in #3479.

Validation: ./gradlew --offline --no-daemon :model:test :manager:test — all 393 tests passed (57 model, 336 manager). Regression tests were added and confirmed failing before the fix.

Checklist

  • 1. Acceptance criteria of the linked issue(s) are met
  • 2. Tests are written and all tests pass (model and manager unit suites)
  • 3. Changes are manually tested by you and the reviewer
  • 4. Documentation is written or updated (copying behavior documented in code)

@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 15:23
@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.

Avoid mutating caller queries in AssetsFacade

1 participant