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
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
== 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.
2 Replies
ZachDaniel
ZachDaniel2y ago
Hm…can you try the latest main branch of each project and see?
Myrmyr
MyrmyrOP2y ago
Switching Ash to master seems to resolve the issue, I've also went commit by commit and - This one does not work https://github.com/ash-project/ash/commit/80ef7973c83e9354ee417e307fd4c563f1e314a9 - This one seems to fix it https://github.com/ash-project/ash/commit/0b6d93c7c4637280b46ae66ea1d2eaf013701238
GitHub
feat: add field_policies · ash-project/ash@0b6d93c
see included documentation for more information on how field policies work.

Did you find this page helpful?