DaAnalyst

DaAnalyst

Parent-child LV bugs I don't have a minimal app to demo yet

So, before I allocate the time required to build a demo app reproducing these two, is there someone else who encountered the two bugs (and may have a demo for them)?

Both bugs regard having a parent and a child live view where the child is initialized with some of the assigns from the parent as in:

  <%= 
    live_render( 
      @socket, 
      MyApp.ChildView, 
      id: "child-view", 
      session: %{ "some_state" => @some_state, "some_other_state" => @some_other_state}
    )
  %>

Bug #1:
Initially, the parent live view does not have any streams to render nor any live components that render streams. The child live view has a live component with a stream. At some point the parent LiveView renders a modal live component and everything is still working. Then, in one of the modal steps, the parent live view’s modal live component renders its first stream. Sometimes, the bug manifests already here in terms of the child live view’s live component stream completely resetting (to 0 elements), but most of the time it passes this stage. Then, in a next step the parent’s live component opens another stream and here the child live view’s live component stream resets for sure.

I double checked everything and the streams are not even called the same (although it should not matter as those are all completely separately managed states) and the ids are all unique.

This exact same setup works well when all the live components with their streams are part of a single live view instance, i.e. if there are no parent and child liveview.

Bug #2:
When there’s a RuntimeException in the mount/3 of the child live view, more often than not, it does not get logged at all.

Thanks

Where Next?

Popular in Questions Top

RisingFromAshes
I’ve read in another post that it may be possible with a router helper - but I couldn’t find an appropriate one, and tbh, I’m still just ...
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New

Other popular topics Top

minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 54006 488
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New

We're in Beta

About us Mission Statement