AshPhoenix.Form.submit is triggering change function to run twice
Say I have a custom change module, like so:
When I run this in the
Now, when I use it in form using
Inside the
Then the event handler looks like this:
With all this in place, the
If I debug inside something like a
When I run this in the
iex terminal, the dbg statement only gets output once. That's what I would expect.Now, when I use it in form using
AshPhoenix.Form, I get the dbg statement two times when doing Form.submit. I even took out all other code so this was the only thing running. The mount would look like this:Inside the
my_action action, it would look like this:Then the event handler looks like this:
With all this in place, the
dbg message at the start ("my cool change") ends up being called two times. I can put a dbg in the handle_event and it's only called once. I've checked everywhere along the path and it's during the Form.submit call that it happens two times. Is that expected behavior or a bug?If I debug inside something like a
before_action that is defined in that same change module, the before_action debug only gets called once, same with action_action. But any code inside that change function at the root gets run two times.