Skip to content

Resolve unique selections to null under a deny-all visibility Scope - #153

Open
jtnelson wants to merge 1 commit into
developfrom
feature/none-scope-unique-selection
Open

Resolve unique selections to null under a deny-all visibility Scope#153
jtnelson wants to merge 1 commit into
developfrom
feature/none-scope-unique-selection

Conversation

@jtnelson

@jtnelson jtnelson commented Aug 1, 2026

Copy link
Copy Markdown
Member

Summary

When an Audience's visibility scope for a Record class denies all access, a unique query (the findUnique path) resolved to an empty Set. The caller of findUnique expects a single Record or null, so the empty Set produced a ClassCastException at the call site.

Behavior

  • A unique query executed through an Audience with a deny-all visibility scope now returns null, consistent with the findUnique contract when no record is visible.
  • Set-valued queries, counts, and load-by-id queries under a deny-all scope behave as before.

Scope

  • The change is limited to result resolution under a deny-all visibility scope. A regression test in AudienceVisibilityScopeIntegrationTest covers the findUnique path.

A findUnique query executed through an Audience whose visibility
scope denies all access previously resolved to an empty Set, even
though the caller expects a single Record or null. The empty Set
produced a ClassCastException at the call site. A unique selection
now resolves to null, matching the findUnique contract.
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.

1 participant