No such input for atomic_update

Suppose I have a resource with attribute:
attributes do
...

attribute :oban_job_id, :integer
end
attributes do
...

attribute :oban_job_id, :integer
end
and an update action
update :set_oban_job_id do
argument :job_id, allow_nil?: false

change atomic_update(:oban_job_id, expr(^arg(:job_id)))
end
update :set_oban_job_id do
argument :job_id, allow_nil?: false

change atomic_update(:oban_job_id, expr(^arg(:job_id)))
end
with a code interface that looks like
define :set_oban_job_id, action: :set_oban_job_id, args: [:job_id]
define :set_oban_job_id, action: :set_oban_job_id, args: [:job_id]
Previously everything ran smoothly, but after recently bumping Ash I'm now getting something like the following when running Product.set_oban_job_id(product, 123):
Invalid Error

* No such input `oban_job_id` for action MyApp.Products.Product.set_oban_job_id

The attribute exists on MyApp.Products.Product, but is not accepted by MyApp.Products.Product.set_oban_job_id

Perhaps you meant to add it to the accept list for MyApp.Products.Product.set_oban_job_id?

Valid Inputs:

* job_id
Invalid Error

* No such input `oban_job_id` for action MyApp.Products.Product.set_oban_job_id

The attribute exists on MyApp.Products.Product, but is not accepted by MyApp.Products.Product.set_oban_job_id

Perhaps you meant to add it to the accept list for MyApp.Products.Product.set_oban_job_id?

Valid Inputs:

* job_id
Changing atomic_update to set_attribute fixes it, and like I said at some previous version of Ash everything worked fine. Was I just inadvertently relying on a bug in Ash that got fixed? If so, what would be the proper way to use atomic_update instead of set_attribute here?
2 Replies
ZachDaniel
ZachDaniel•4mo ago
🤔 this is a bug Please reproduce in a test And I will fix

Did you find this page helpful?