Skip to content

Conversation

maennchen
Copy link
Contributor

Changes

Fixes application of field policies that contain a bypass with entry conditions.

Fiexes: https://github.com/ash-project/ash/actions/runs/18414010761/job/52473216042

** (Ash.Error.Framework) 
Bread Crumbs:
  > Exception raised in: GF.Event.read> Exception raised in: GF.Attendee.read

Framework Error

* Assumption failed: FieldPolicy conditions should always be true. Condition:

"actor.__struct__ == GF.Member"

This should not be possible, please report a detailed bug at:

https://github.com/ash-project/ash/issues/new?assignees=&labels=bug%2C+needs+review&template=bug_report.md&title=

  (ash 3.6.2) lib/ash/error/framework/assumption_failed.ex:3: Ash.Error.Framework.AssumptionFailed.exception/1
  (ash 3.6.2) lib/ash/policy/policy.ex:75: anonymous fn/2 in Ash.Policy.Policy.expression/1
  (ash 3.6.2) lib/ash/policy/policy.ex:50: Ash.Policy.Policy.expression/1
  (ash 3.6.2) lib/ash/policy/policy.ex:151: Ash.Policy.Policy.build_requirements_expression/1
  (ash 3.6.2) lib/ash/policy/policy.ex:95: Ash.Policy.Policy.solve/1
  (ash 3.6.2) lib/ash/policy/checker.ex:65: Ash.Policy.Checker.strict_check_scenarios/1
  (ash 3.6.2) lib/ash/policy/authorizer/authorizer.ex:1732: Ash.Policy.Authorizer.strict_check_result/2
  (ash 3.6.2) lib/ash/policy/authorizer/authorizer.ex:1127: Ash.Policy.Authorizer.field_condition/5
  (ash 3.6.2) lib/ash/policy/authorizer/authorizer.ex:1081: Ash.Policy.Authorizer.expression_for_ref/6
  (ash 3.6.2) lib/ash/policy/authorizer/authorizer.ex:1005: Ash.Policy.Authorizer.replace_refs/2
  (ash 3.6.2) lib/ash/policy/authorizer/authorizer.ex:971: Ash.Policy.Authorizer.replace_refs/2
  (ash 3.6.2) lib/ash/policy/authorizer/authorizer.ex:727: Ash.Policy.Authorizer.alter_filter/3
  (ash 3.6.2) lib/ash/can.ex:495: Ash.Can.alter_query/5
  (elixir 1.18.4) lib/enum.ex:2546: Enum."-reduce/3-lists^foldl/2-0-"/3
  (ash 3.6.2) lib/ash.ex:1812: Ash.can/3
  (ash 3.6.2) lib/ash/actions/read/read.ex:2053: Ash.Actions.Read.authorize_query/2
  (ash 3.6.2) lib/ash/actions/read/read.ex:583: Ash.Actions.Read.do_read/5
  (ash 3.6.2) lib/ash/actions/read/read.ex:432: Ash.Actions.Read.do_run/3

Contributor checklist

Leave anything that you believe does not apply unchecked.

  • I accept the AI Policy, or AI was not used in the creation of this PR.
  • Bug fixes include regression tests
  • Chores
  • Documentation changes
  • Features include unit/acceptance tests
  • Refactoring
  • Update dependencies

@zachdaniel zachdaniel merged commit 64822a7 into ash-project:main Oct 10, 2025
39 of 45 checks passed
@maennchen maennchen deleted the jm/field_policy_fix branch October 10, 2025 22:26
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.

2 participants