Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix streams in sticky LV being reset when same ref #3683

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

SteffenDE
Copy link
Collaborator

Fixes #3681.

Child LiveViews would use the same data-phx-stream-ref, so it could happen that they were cleared unexpectedly because we did not always check the owner of the stream element when pruning.

There was another issue at play though: because we used assign_new to set the streams, nested LiveViews would copy a parent's streams, instead of creating a fresh one. This would lead to mixed up streams in the dead render.

Fixes #3681.

Child LiveViews would use the same data-phx-stream-ref, so it could
happen that they were cleared unexpectedly because we did not always
check the owner of the stream element when pruning.

There was another issue at play though: because we used assign_new to
set the streams, nested LiveViews would copy a parent's streams, instead
of creating a fresh one. This would lead to mixed up streams in the dead
render.
@SteffenDE
Copy link
Collaborator Author

I will add a test later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

A misconfigured stream causes different streams in sticky liveviews to be reset by the client.
1 participant