The domain Foo.Bar requires that an actor is provided at all times and none was provided.

Noticed this when running tests against latest main. We have our domains set up like:
authorization do
authorize :by_default
require_actor? true
end
authorization do
authorize :by_default
require_actor? true
end
And when we're using authorize?: false, like in tests, we'd also pass actor: nil to not have errors. But now on main, it looks like actor: nil is throwing forbidden errors with this config where it didn't before:
** (Ash.Error.Forbidden)
Bread Crumbs:
> Exception raised in: Foo.Bar.read

Forbidden Error
** (Ash.Error.Forbidden)
Bread Crumbs:
> Exception raised in: Foo.Bar.read

Forbidden Error
Do you know if this change was intentional or not?
Solution:
just pushed to main
Jump to solution
10 Replies
ZachDaniel
ZachDaniel•4mo ago
not intentional, looking into it
Solution
ZachDaniel
ZachDaniel•4mo ago
just pushed to main
pikdum
pikdumOP•4mo ago
cool, testing now i'm looking forward to elixir 1.19's compilation speed improvements, lol our app takes a pretty long time to compile all the dependencies still seeing forbidden errors, but slightly different stacktrace than before
ZachDaniel
ZachDaniel•4mo ago
šŸ¤” interesting.
pikdum
pikdumOP•4mo ago
pikdum
pikdumOP•4mo ago
think this test is going through AshJsonApi somehow?, let me verify it still happens with main of that yep
ZachDaniel
ZachDaniel•4mo ago
šŸ¤” "(ash 3.5.15) lib/ash/policy/check/expression.ex:3: Ash.Policy.Check.Expression.check/4", that is surprising... what data layer are you using?
pikdum
pikdumOP•4mo ago
AshPostgres.DataLayer we do have some simple checks with access_type :runtime on read, it looks like let me double check i'm actually on latest main
ZachDaniel
ZachDaniel•4mo ago
okay šŸ¤”
pikdum
pikdumOP•4mo ago
blah, yeah i was locked on the previous commit can confirm it's fixed with https://github.com/ash-project/ash/commit/34193cb1eb4c11ae28a514182094d7da0e187467 all tests passing thanks!

Did you find this page helpful?