Why is require_atomic? false required here?

I have a Resource InboxMessage with the following actions

actions do
    update :verify do
      require_atomic? false
      change set_attribute(:status, :verified)
      change set_attribute(:actioned_at, &DateTime.utc_now/0)
      change set_attribute(:action_by_pda_url, actor(:pda_url))
    end

    update :reject do
      require_atomic? false
      change set_attribute(:status, :rejected)
      change set_attribute(:actioned_at, &DateTime.utc_now/0)
      change set_attribute(:action_by_pda_url, actor(:pda_url))
    end
  end

Why would my update fail if I don’t put in the require_atomic? false?

The error message should tell you some detail. What does it say?

[error] GenServer #PID<0.1063.0> terminating
** (Ash.Error.Unknown)
Bread Crumbs:
> Exception raised in: CheckD.Domains.MyData.Resources.InboxMessage.verify

Unknown Error

* ** (WithClauseError) no with clause matching: #Ash.Changeset<domain: 
CheckD.Domains.MyData, action_type: :update, action: :verify, attributes: %{}, 
relationships: %{}, arguments: %{}, errors: [], data: 
#CheckD.Domains.MyData.Resources.InboxMessage<user_badge: 
#CheckD.Domains.User.Resources.UserBadge<inbox_messages: 
#Ash.NotLoaded<:relationship, field: :inbox_messages>, badge: 
#CheckD.Domains.Badge.Resources.Badge<no_of_validating_scans_by_validator: 
#Ash.NotLoaded<:calculation, field: :no_of_validating_scans_by_validator>, 
no_of_validating_scans: #Ash.NotLoaded<:calculation, field: :no_of_validating_scans>, 
...
<remaining stuff about my schema>

This looks like a bug somewhere internally. Are you on the latest Ash version?

Yes. Using the latest and greatest.

* ash 3.4.63 (Hex package) (mix)
* ash_cloak 0.1.3 (Hex package) (mix)
* ash_phoenix 2.1.18 (Hex package) (mix)
* ash_postgres 2.5.2 (Hex package) (mix)
* ash_sql 0.2.56 (Hex package) (mix)

elixir
*1.18.2-otp-27
erlang
*27.2.1

LMK if you’d like me to open an issue on ash git

Please do, the primary thing that I will need to look into this is a reproduction of some kind.

Done.

`Unknown Error` thrown when `require_atomic? false` is missing in an update `Action` · Issue #1791 · ash-project/ash · GitHub

And thanks!