Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

query-db: requestSnapshot caller abort leaves sole fetch live and publishes late rows

Đang mở
#2,162 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

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
18/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-engineering

Hướng nghiên cứu

Start with the failing witness cancels the final public snapshot acquisition on caller abort in packages/query-db-collection/tests/load-subset-lifecycle-oracle.test.ts and trace how the requestSnapshot signal reaches the Query-backed acquisition and its unloadSubset call. Done means the sole-owner test sees the transport signal aborted, the load promise rejected, and no late row, while peer-owner and abort-after-commit cases still pass. Read the Collection sync-adapter guide before changing ownership handling, since Core also aborts this signal during normal release.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Bug

Aborting the signal passed to a public subscription.requestSnapshot({ signal }) leaves a sole Query-backed acquisition active. Its provider fetch stays live, the returned load promise fulfills, and a row returned afterward becomes visible.

Reproduction

On PR #2158 at 28f9ed6aa, the cancels the final public snapshot acquisition on caller abort witness in packages/query-db-collection/tests/load-subset-lifecycle-oracle.test.ts uses a held provider result. After the caller aborts, the observed result is:

transport signal aborted: false
load promise: fulfilled
Collection rows: [{ id: "late" }]

The expected result is an aborted sole transport, a rejected load, and no late row. This is a public requestSnapshot path, not a direct _sync.loadSubset call.

Contract and repair boundary

The Collection sync-adapter guide requires request-scoped commits to honor the request abort signal. A shared physical Query must remain live while another acquisition owns it, so abort handling must distinguish the caller's acquisition from the Query's remaining owners. A direct attempt to unload on every acquisition-signal abort broke three existing cleanup/peer histories: Core also aborts that signal during ordinary release, before invoking unloadSubset.

The load-subset lifecycle oracle should cover both sole and peer owners at the caller-abort cut, plus abort after commit acceptance. The existing held-fetch peer tests abort and explicitly unload together, so they do not isolate caller abort. Keep the sole-owner witness as an expected failure until the ownership boundary is repaired.

Ngôn ngữ chính
TypeScript
Star
4k
Fork
277
Merge trung bình
18 giờ 49 phút
Pull request đã merge (30 ngày)
224

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của TanStack/db

Tất cả issue của TanStack/db

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.