Turbo_stream.append acts as turbo_stream.replace

Hi. so i just upgraded from turbo v5 to turbo v7. everything is working file and well. exept on this page, so basically i have this

<%= turbo_stream.append "audience" do %>
.... some content
<% end %>

When i return the response. it’s all successfull and when checking the network tab i can see the response. However, the content inside the audience container is all removed for some reason. The weird thing i have turbo_stream.appened in different pages and it works perfectly fine, except on this page. any ideas would be welcome. thanks

Edit

after some further investigation it turns out for some reason it replaces nodes for each other.

See: Remove target children with duplicate ID before append/prepend by jeromecornet · Pull Request #240 · hotwired/turbo · GitHub

1 Like

This also seems to have the side effect of removing all children without an ID as well. Just ran into this with our flash messages.