Phoenix LiveView Phoenix.Sync.LiveView.sync_stream evaluation
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- elixir
- Lĩnh vực
- backend, databases, distributed-systems
Hướng nghiên cứu
Bắt đầu với các entry point Phoenix.Sync.LiveView.sync_stream và sync_stream_update được đề cập trong issue, sau đó theo dõi cách dead render, live render ban đầu, độ cũ của snapshot và tùy chọn limit được xử lý. So sánh hành vi quan sát được với dữ liệu ban đầu hiện tại được yêu cầu, dữ liệu dead render mới, việc làm mới snapshot có thể cấu hình và các giới hạn hoạt động đúng; issue không nêu tên các file hoặc test cụ thể.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Elixir
- Star
- 290
- Fork
- 18
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của electric-sql/phoenix_sync
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 52/100
electric-sql/phoenix_sync#128 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 72/100
electric-sql/phoenix_sync#126 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
electric-sql/phoenix_sync#119 ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
electric-sql/phoenix_sync#118 · 8 reaction ·
-
0.6.0 -> 0.6.1: protocol Phoenix.Sync.Adapter.PlugApi not implemented for Electric.Shapes.ApiĐang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
electric-sql/phoenix_sync#117 · 5 bình luận ·
Tất cả issue của electric-sql/phoenix_sync
Issue tương tự
-
bug(bgp): every BGP routing upsert fails because ON CONFLICT names an index, not a constraintĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
carverauto/serviceradar#5732 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Markdown preview can show an outdated version of the cell sourceCó thể đã có người làm @RaphaelFakhri đã nhận 1 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
livebook-dev/livebook#3228 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 93/100
TomerAberbach/profiler-md#732 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
inertiajs/inertia-phoenix#84 ·
-
good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
beyond-all-reason/teiserver#1676 ·
Maintainer thường phản hồi trong vòng 1 ngày