Electric on-demand skips updates to unknown rows that enter a served ordered range
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- typescript
- Lĩnh vực
- data
Hướng nghiên cứu
Start at packages/electric-db-collection/src/electric.ts near line 2382, where updates for rows the Collection does not know are skipped unless the shape uses replica: 'full'. Read docs/collections/electric-collection.md around line 414 for the documented 'unknown partial rows are ignored' behavior. Done means a witness test with the mocked ShapeStream shows the window moving from [10, 4] to [10, 7], and the server's actual messages for this row are confirmed. The fix approach is still an open design choice among the options in the issue.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem
An on-demand Electric collection with the default replica mode can show a wrong ordered window. A row that the Collection did not load can move into a served ordered range, and the Collection never receives it.
Electric skips an update for a row that the Collection does not know, unless the shape uses replica: 'full' (packages/electric-db-collection/src/electric.ts, near line 2382). A default-replica update contains only the changed columns, so the client cannot make the row from it. The documentation states this behavior: "unknown partial rows are ignored" (docs/collections/electric-collection.md:414).
This conflicts with the LoadSubset rule from #2136: a provider keeps each served ordered range whole. After a load serves an ordered, limited page, every row that later sorts inside that range must arrive. Electric's move-in and tag messages apply to rows that Electric already knows. They do not cover a row that newly sorts into a limited ordered range.
Reproduction
On-demand mode, default replica, live query orderBy(rank desc).limit(2).
- Rows with rank 10, 4, 1, 0. The window is
[10, 4]. - The shape stream sends an update for the row with rank 0, which the Collection did not load. Its rank changes to 7.
- Expected window:
[10, 7]. Actual window:[10, 4].
With replica: 'full', the row arrives and the window is [10, 7].
A witness test uses the package's mocked ShapeStream. It will go into the fix PR. It does not prove which messages a real Electric server sends for this row. The fix PR must confirm that against the server or its documentation.
Options
- When an update arrives for an unknown row, fetch the full row, or reload the served subsets that the row can enter.
- Invalidate the limited ordered subsets when such an update arrives, so that the DB loader requests them again.
- Accept the gap as a limit, and document that ordered on-demand windows need
replica: 'full'.
Related: #2136 (the same rule for query-db).
This issue was written by Isaac.
- Ngôn ngữ chính
- TypeScript
- Star
- 3.9k
- Fork
- 272
- Merge trung bình
- 1 ngày 48 phút
- Pull request đã merge (30 ngày)
- 238
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọ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 TanStack/db
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 12/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Ordered, limited live query over a string key commits `loading` first (and `orderBy().findOne()` since 0.11.1)Có thể đã có người làm @KyleAMathews đã nhận hôm nay. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 18/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 18/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 18/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 8/100
Maintainer thường phản hồi trong vòng 1 ngày
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
AvaProtocol/ava-sdk-js#276 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
useFragment does not require `variables` when the fragment's variables type has required fieldsĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
apollographql/apollo-client#13493 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Custom hosts written as trailing-dot FQDNs (`host.local.`) aren't detected as local backendsCó thể đã có người làm @roboomp đã nhận hôm nay. Đang mởbug prio:p2 providers triaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
can1357/oh-my-pi#15798 · 3 bình luận ·
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 62/100
code-yeongyu/oh-my-openagent#10172 ·
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 70/100
PDFCraftTool/pdfcraft#189 ·