phoenix_live_view
phoenix_live_view copied to clipboard
Lacking a way for a nested LiveView to crash its parent in mount/first render when the two are linked
LiveView version: 0.20.14 (but since nothing of the kind can be found in the 1.0.0rc changelog, I expect it to be there as well)
- A
RuntimeException
taking place in a nested LiveView process over its post-mount life cycle result in its restart, as it should. - Same scenario but with the nested LV process linked to its parent results in having them both restarted. Again, as it should.
- A
RuntimeException
taking place at any point in the parent lifecycle, including while mounting results in its restart, as it should.
However, regardless of whether the two processes are linked, I can't get a crashing nested LiveView process crash its parent process along if the crash is occurring while the child is getting mounted or while rendering after mounting. This is a problem, for the desired behavior for an unhandled exception in this case would be to let it crash i.e. consequently have the 500 error page rendered (especially in production), while instead we get an immediate retry of a nested LiveView mount on behalf of its (manually linked!!) parent and then an exponential backoff-like wait forever.
Can it be done so that there's at least a configuration parameter (an option) in the live_render/3
function that will ensure that the failure of the nested LiveView process will bring down the parent as well if the two are linked?
Thanks!