-
-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error building Reactor execution graph when using switch with result template helper #136
Comments
Here's a simpler example that reproduces the same problem: defmodule Level.Resources.ProvisionUser do
@moduledoc """
Provisions a user account.
"""
use Ash.Reactor
alias Level.Resources.OnboardingCode
ash do
default_domain Level
end
input :code
read_one :onboarding_code, OnboardingCode, :by_code do
inputs(%{code: input(:code)})
end
switch :has_code do
on result(:onboarding_code)
matches? &(not is_nil(&1)) do
debug :debug do
argument :onboarding_code, result(:onboarding_code)
end
end
end
return :onboarding_code
end Generates the following error:(Reactor.Error.Internal.PlanError) # Reactor Plan Error An error occurred while building or updating the Reactor execution graph. Step Step
Graph
|
This fixes a bug where a Reactor would fail when steps are added at runtime which depend on an already computed result. This is required to fix #136 which stops a Reactor from planning nested switch steps.
@sbennett33, @mitel I'm so sorry about the long delay on this one, but it's fixed in main and I'll be releasing it later on today. |
Thank you!! |
Describe the bug
The code below fails to compile (after a mix clean). Error:
The execution graph cannot find a step outside the switch statement when using the
result
template helper.To Reproduce
Reactor.run(SwitchReactor, %{value: "zen"})
Expected behavior
The inner switch step should be able to use the result template helper.
Runtime
Additional context
After multiple compilations at some point it started to work, but once I did a
mix clean
it failed again to compile.The text was updated successfully, but these errors were encountered: