Unknown options [:compensate], valid options are: [:async?, :max_retries, :transform, :context, :description, :guards, :ref]

Just upgraded ash from 3.4.36 to 3.4.62 and I start to get this error in my reactor module. My code has no :compensate in my_reactor.ex, so I’m assuming it’s coming from Ash.Reactor. Can someone please give some pointers?

== Compilation error in file lib/myapp/reactor/my_reactor.ex ==
**** (Spark.Options.ValidationError) unknown options [:compensate], valid options are: [:async?, :max_retries, :transform, :context, :description, :guards, :ref]**
(spark 2.2.43) lib/spark/dsl/extension.ex:702: Spark.Dsl.Extension.raise_transformer_error/2
(elixir 1.17.2) lib/enum.ex:4858: Enumerable.List.reduce/3
(elixir 1.17.2) lib/enum.ex:2585: Enum.reduce_while/3
myapp/lib/myapp/reactor/my_reactor.ex:1: (file)

defmodule MyApp.MyReactor do
  use Ash.Reactor

  alias MyApp.Tasks.DateInstance

  ash do
    default_domain MyApp.Tasks
  end

  input(:calendar_id)
  input(:date_input)

  ash_step :date_change_calc, MyApp.Tasks.DateChangeCalcStep do
    argument :calendar_id, input(:calendar_id)
    argument :date_input, input(:date_input)
  end

  transaction :delete_and_insert, DateInstance do
    step :delete_unnecessary_date_instances,
         MyApp.Tasks.DeleteUnnecessaryDateInstancesStep do
      argument :date_change_calc_output, result(:date_change_calc)
    end

    step :upsert_updated_date_instances, MyApp.Tasks.UpsertUpdatedDateInstancesStep do
      argument :date_change_calc_output, result(:date_change_calc)
    end
  end

  return(:delete_and_insert)
end

This may be an accidental breaking change not reflected in Ash’s dependency on reactor? Try mix deps.update reactor @jimsynz should we update ash’s dependency or something?

It looks like they already have Reactor 0.11 (judging by guards being allowed in the options). Steps definitely have a compensate option however.

Strange. Something must have broken it in ash_reactor. Please open a bug and we will look into it.

I think it’s related to ash_step which calls Builder.add_step, which has first step

{:ok, options} <- Spark.Options.validate(options, @option_schema),

and the problem is in @option_schema which does not have this new option.

I made a PR adressing this.

2 Likes