Call send/2 from LiveComponent

I’m working on a LiveView that contains a LiveComponent that implements steps:

live "/procedure/*glob", MyAppLive, :procedure

The parent LiveView renders the LiveComponent when handle_params/3 is called.
All of the steps have corresponding paths:

  • /procedure
  • /procedure/second
  • /procedure/third

When moving into the next step I call push_patch/2 to make the back button work as correctly as possible.
By doing so, users can navigate backward, change settings and then navigate forward without hitting the next button (which may even be disabled).

The steps are implemented in seperate LiveComponents nested inside the procedure LiveComponent.
These steps implement handle_event/3, call push_patch/2 and send_update/3 to notify the parent LiveComponent.

The problem is that only the parent LiveComponent knows whether the current path is valid relative to the settings collected from the steps.
So in case of an invalid current path the parent LiveComponent would want to patch the path to the first availabe valid step.
This is not possible though because the parent does not implement any event handler, only update/2.

I’m hacking around this limitation, but I am wondering whether I should be doing that.

# procedure LiveComponent
if step > max_step do
  send(self(), {:patch, path_to_max_step})
end

# LiveView
def handle_info({:patch, live_route}, socket) do
  {:noreply, push_patch(socket, to: live_route, replace: true)}
end

Maybe someone can advise me.
Or maybe there is an intended way of doing this that I don’t know about.