Ash FrameworkAF
Ash Framework2mo ago
6 replies
Ahrou

Is it possible to use bulk_update with ash_events?

We have a Resource which has a main :update action, when it is called by users we need ash_events to record it but not when our internal processing oban job calls it.

So we are replacing those bulk_updates with Repo.update_all but this ignores Ash's benefits, our validation/changes in the action.

Is there some opt that can be passed in the bulk_update that skips ash_events?

BTW this is the error we get when trying to enable events for that action (before we changed it):
%Ash.Error.Unknown{
       errors: [
         %Ash.Error.Unknown.UnknownError{
           error: "unknown error: %Ash.BulkResult{status: :error, errors: [%Ash.Error.Invalid{errors: [%Ash.Error.Invalid.NoMatchingBulkStrategy{resource: App.Core.Contact, action: :update, requested_strategies: [:atomic], not_stream_reason: nil, not_atomic_batches_reason: \"Not in requested strategies\", not_atomic_reason: \"manual action `App.Core.Contact.update` cannot be performed atomically\", footer: nil, splode: Ash.Error, bread_crumbs: [], vars: [], path: [], stacktrace: #Splode.Stacktrace<>, class: :invalid}]}], records: nil, notifications: nil, error_count: 1}",
           field: nil,
           value: nil,
           splode: Ash.Error,
           bread_crumbs: [],
           vars: [],
           path: [],
           stacktrace: #Splode.Stacktrace<>,
           class: :unknown
         }
       ]
     }
Was this page helpful?