Ash FrameworkAF
Ash Framework3y ago
2 replies
Myrmyr

Updating Spark to 1.1.17 breaks Ash.Flow transaction DSL

Ash version: 2.10.2
Spark latest working version: 1.1.16
Spark version that breaks: 1.1.17

Example code:
defmodule MyApp.Flows.ExampleFlow do
  @moduledoc false

  use Ash.Flow

  flow do
    api MyApp.Api

    argument :example_arg, :map do
      allow_nil? false
    end

    returns :some_transaction
  end

  steps do
    # This works
    custom :custom_step_that_do_not_break, MyApp.Flows.Steps.SimpleReturn do
      input %{
        return: arg(:example_arg)
      }
    end

    transaction :some_transaction, MyApp.SomeEntity do
      # This does not work
      custom :custom_step_that_breaks, MyApp.Flows.Steps.SimpleReturn do
        input %{
          return: arg(:example_arg)
        } 
      end
    end
  end
end


Error message:
== Compilation error in file lib/my_app/flows/example_flow.ex ==
** (CompileError) lib/my_app/flows/example_flow.ex:24: undefined function custom/3 (there is no such import)
    (stdlib 4.1.1) lists.erl:1462: :lists.mapfoldl_1/3
    (ash 2.10.2) expanding macro: Ash.Flow.Dsl.Steps.Transaction.transaction/3


Didn't know whether this should be reported to Spark or Ash so I'm reporting it here.
Was this page helpful?