Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

Ordered loader: a page-capping provider loses a moved row from a joined window after refetch

未關閉
#2,183 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
18/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
typescript
領域
databases

研究方向

Start with the pinned it.fails test in packages/query-db-collection/tests/refetch-ordered-prefix-oracle.test.ts, which encodes the eight-step history against a provider with pageCap 2. Run it to see the failure 'window after refetch at step 3 was []; expected [7]', then trace where the ordered loader's repair path treats a short page as exhaustion. Read PR #2154 on branch fix-query-db-refetch-ordered-gap first. Done when the test passes without the it.fails marker and the refetch oracle's generated scenarios accept pageCap.

由索引模型根據 Issue 內容生成。

描述

Summary

With a provider that returns fewer rows than a request's limit (a page cap), an on-demand joined ordered window can lose a row after a refetch. The row's order changed, and the loader's own repair drops it. A short reply does not prove that the source is exhausted (glossary), so the loader must keep reading.

Reproduction

The pinned witness is a capped provider keeps a moved row in the window after a refetch (known loader defect) in packages/query-db-collection/tests/refetch-ordered-prefix-oracle.test.ts (branch fix-query-db-refetch-ordered-gap, PR #2154). It is an it.fails test today.

  • Provider: cursor encoding, pageCap: 2.
  • Query: rank desc, offset 1, limit 2, LEFT-joined marker filter.
  • Initial rows: id 0 (rank 1, marked), id 1 (rank 0, unmarked).
  • History:
    1. Mark id 7.
    2. Upsert id 2 at rank 1.
    3. Upsert id 7 at rank 0.
    4. Refetch.
    5. Delete id 3.
    6. Invalidate.
    7. Upsert id 3 at rank 1.
    8. Upsert id 0 at rank 0.

Failure: window after refetch at step 3 was []; expected [7].

Scope

This reproduces on main, through the loader's own repair. It is separate from #2136. The query-db refetch oracle's generated campaigns use an uncapped provider because of this defect. A page-capped trace together with a peer live query also fails (found while #2154 was reviewed). That trace fails the same way with the loader's first-page skip disabled.

Suggested witness and owner

  • Owner: the ordered loader. The repair and continuation path must treat a short page as "not exhausted".
  • Witness: flip the pinned it.fails test, then add pageCap to the query-db refetch oracle's generated scenario.

This issue was written by Isaac.

主要語言
TypeScript
星號
3.9k
分支
272
平均合併
22 小時 54 分鐘
30 天內合併 PR
236

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

TanStack/db 的其他 Issue

查看 TanStack/db 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。