-
Notifications
You must be signed in to change notification settings - Fork 959
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
A misconfigured stream causes different streams in sticky liveviews to be reset by the client. #3681
Comments
SteffenDE
added a commit
that referenced
this issue
Feb 19, 2025
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
added a commit
that referenced
this issue
Feb 25, 2025
* fix streams in sticky LV being reset when same ref 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. * fix test on latest elixir * add test
SteffenDE
added a commit
that referenced
this issue
Feb 25, 2025
* fix streams in sticky LV being reset when same ref 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. * fix test on latest elixir * add test
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Environment
Actual behavior
Ultimately, this is issue is related to our code. I am reporting it in case it's indicative of something deeper.
reset: true
option.A single file app reproducing the issue follows:
Expected behavior
As noted, this is my bug. By removing the second stream initialization the problem goes away. However, I think that it should not have been evident in the first place. That is, stream A should not be interfering with stream B.
The text was updated successfully, but these errors were encountered: