Phoenix LiveView Phoenix.Sync.LiveView.sync_stream evaluation
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- elixir
- Ambito
- backend, databases, distributed-systems
Direzione di ricerca
Inizia dagli entry point Phoenix.Sync.LiveView.sync_stream e sync_stream_update menzionati nell’issue, quindi segui come vengono gestiti i dead render, i live render iniziali, l’età dello snapshot e l’opzione limit. Confronta il comportamento osservato con i dati iniziali correnti richiesti, i dati freschi del dead render, l’aggiornamento configurabile dello snapshot e limiti funzionanti; l’issue non indica file o test specifici.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Elixir
- Stelle
- 290
- Fork
- 17
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Non abbiamo ancora controllato i file di configurazione di questo progetto. Parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di electric-sql/phoenix_sync
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 52/100
electric-sql/phoenix_sync#128 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 72/100
electric-sql/phoenix_sync#126 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
electric-sql/phoenix_sync#119 ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
electric-sql/phoenix_sync#118 · 8 reazioni ·
-
0.6.0 -> 0.6.1: protocol Phoenix.Sync.Adapter.PlugApi not implemented for Electric.Shapes.ApiAperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
electric-sql/phoenix_sync#117 · 5 commenti ·
Tutte le issue di electric-sql/phoenix_sync
Issue simili
-
TS2502 in shipped .d.ts: `compileHighlightConfig` parameter shadows the de-aliased `Query` typeApertabug javascript
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
GitHub docs are outdatedApertaL: javascript T: bug 🐞
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
dependabot/dependabot-core#16397 ·
I maintainer di solito rispondono entro 1 giorno
-
Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
wintermeyer/vutuv#2297 ·
I maintainer di solito rispondono entro 1 giorno
-
high priority tachyon protocol
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
beyond-all-reason/teiserver#1616 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
erlef/mix_sbom#157 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 7 giorni