Phoenix LiveView Phoenix.Sync.LiveView.sync_stream evaluation
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 25/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- elixir
- Área
- backend, databases, distributed-systems
Línea de trabajo
Comienza con los puntos de entrada Phoenix.Sync.LiveView.sync_stream y sync_stream_update mencionados en el issue, y luego sigue cómo se gestionan los dead renders, los live renders iniciales, la antigüedad del snapshot y la opción limit. Compara el comportamiento observado con los datos iniciales actuales solicitados, los datos nuevos de dead render, la actualización configurable del snapshot y unos límites que funcionen; el issue no menciona archivos ni tests específicos.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Hello 👋🏻
I'm evaluating Phoenix.Sync.LiveView.sync_stream in my Phoenix LiveView application. Particular use case I'm checking is notification stream - I want to display notifications and keep them up to date in the UI.
I'm using it in the "standard" way:
defmodule MyWeb.MyLive do
use Phoenix.LiveView
import Phoenix.Sync.LiveView
def mount(_params, _session, socket) do
{:ok, sync_stream(socket, :todos, Todos.Todo)}
end
def handle_info({:sync, event}, socket) do
{:noreply, sync_stream_update(socket, event)}
end
end
After playing with it for some time, I have these observations that surprised me.
deadrender always has no data in stream - it's not ideal in tests and differs from the original LiveView approach.- initial
liverender stream has old (sometimes very old) data. It means there's a lot of catching up to be done on each page refresh (since I'm not using client-side caching) - Limit query seems to be not working, it silently ignores it.
So my questions:
-
Regular phoenix applications are being "mounted" frequently, on each page navigation. Currently it means each such mount is followed by a lot of catching up, which is visible in UI. I understand it's done that way to reduce database load, but it's not ideal. Is there an easy option to configure max snapshot age before it's refreshed?
-
Is there a way to get similar behaviour to phoenix streams in tests? I'm asking about dead render having fresh data (without cache)
-
Is there a way to respect limit query in the initial render?
Phoenix.Sync.LiveView.sync_stream(.., ..,.., limit: 10)doesn't seem to work.
In general, I have a feeling that sync_stream is promising, but not yet battle-tested utility. Which is a shame.
What I was hoping for:
I would love a solution that would work in the same way as "stock" phoenix live view streams
- initial data is always "current", present for both dead and initial live render, so there's not a lot of catching up, with limits working
- I don't have to "babysit" these streams with lots of pubsub broadcasts and subscribes, it would just stay synchronized out of the box.
All in all, I'm rooting for this project! It's really impressive how it's all working, just wanted to drop my own observations.
- Lenguaje dominante
- Elixir
- Estrellas
- 290
- Forks
- 17
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de electric-sql/phoenix_sync
-
Dificultad 3/5 1-2 días Aptitud para principiantes 52/100
electric-sql/phoenix_sync#128 ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 72/100
electric-sql/phoenix_sync#126 ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
electric-sql/phoenix_sync#119 ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
electric-sql/phoenix_sync#118 · 8 reacciones ·
-
0.6.0 -> 0.6.1: protocol Phoenix.Sync.Adapter.PlugApi not implemented for Electric.Shapes.Api Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
electric-sql/phoenix_sync#117 · 5 comentarios ·
Todos los issues de electric-sql/phoenix_sync
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
carverauto/serviceradar#4596 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
agentjido/jido_harness#80 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
sevenseacat/cinder#235 ·