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
Regression in 0.20 when resetting a stream that contains the same values, but reordered. #2826
Comments
For those who wants to upgrade to 0.20, here's a workaround that works for me. In my case, I know that all the elements are present on the page, so deleting and adding each element "solves" the problem. socket
|> then(fn socket ->
Enum.reduce(items, socket, fn item, socket ->
socket
|> stream_delete(:items, item)
|> stream_insert(:items, item)
end)
end) However, this won't work on pages where I use pagination. Not sure how to quickly fix this without tracking the items on the page. |
We stumbled across this as well trying to update to LV 0.20.1 from 0.19.5. We rely on |
Closed via ddccaa6 |
Thanks! |
I can confirm the commit fixes this issue. Thanks ! ❤️ |
I seem to be having an issue with I might be able to reproduce it later, but I was able to confirm that the problem exists on |
I was able to replicate this with normal pagination as well (offset/limit) |
@ivank the version 0.20.2 should solve this issue. |
I've confirmed I still see the issue in 0.20.2 |
I'm having an issue with regular old offset pagination and filtering. It remembers the positions of the filtered elements and they stick around when filters are reset. For example, consider this list:
If I filter on "Hello" the results are:
And when reseting the filters, which also does a stream reset, I get:
This does not happen on |
@sodapopcan #2969 should fix this |
Environment
Actual behavior
With the previous version of Phoenix Live View (0.19.5), when I reset a stream with
stream(socket, :my_stream, values, reset: true)
inhandle_params
orhandle_event
wherevalues
are the same as the previous stream but reordered, the stream was reinitialized. It is useful with a table when you order by a column (asc/desc).With the latest version of Phoenix Live View (0.20.0), the stream is not reset, and the table does not change.
Here is the code that reproduces the behaviour. Below, you will find the simple app that reproduces the bug.
Here is a working application (0.19.5): https://github.com/Malian/stream_reset_bug
Here is the application upgraded to Phoenix Live View (0.20.0): Malian/stream_reset_bug#1
Expected behavior
The stream has been reset.
The text was updated successfully, but these errors were encountered: