ash-project / ash

A declarative, extensible framework for building Elixir applications.
https://www.ash-hq.org
MIT License
1.63k stars 218 forks source link

Filter in resourceless update not making changes after Ash 3.4.29 #1559

Closed haste closed 3 weeks ago

haste commented 3 weeks ago

Describe the bug

After upgrading to Ash 3.4.29 one of our update actions have stopped updating.

To Reproduce

The relevant code is the logout action in lib/helpdesk/account/user_session.ex:

    update :logout do
      change filter expr(session_uid == ^actor(:session_uid))
      accept []
      change set_attribute(:user_id, nil)
    end

Full minimal reproduction project: https://github.com/haste/ash_filter_in_resourceless_update_bug Run mix test.

Downgrading Ash to 3.4.28 makes the test pass.

Expected behavior

Expected behavior is for the action to run a SQL UPDATE statement setting user_id to null.

Runtime

Additional context

This was initially reported on the Elixir slack

zachdaniel commented 3 weeks ago

This appears to have already been fixed in latest main of ash and ash_postgres. As such, I will close this. Those will be released this week.