Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Ordered loader: an offset-only provider leaves a joined on-demand window empty at preload

Aperta
#2,182 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
15/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
databases, typescript
Ambito
data, databases

Direzione di ricerca

The defect lives in packages/db/src/query/live/ordered-source-loader.ts, where the continuation offset is repeated and capped at the window size; read ARCHITECTURE.md "Ordered requests, continuation, and recovery" first. Start by running the pinned it.fails test in packages/query-db-collection/tests/refetch-ordered-prefix-oracle.test.ts (PR #2154 branch). Done means that test passes as a normal test and the oracle's generated scenarios also cover encoding: offset.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Summary

An on-demand ordered live query with a joined filter shows an empty window at preload when the provider honors offset but not cursor. LoadSubsetOptions allows either encoding.

Reproduction

The pinned witness is an offset-only provider fills a joined window at preload (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.

  • Source: an on-demand Query Collection whose queryFn applies where, sorts, skips offset rows and applies limit. It ignores cursor.
  • Query: rank desc, limit 1, LEFT join to a marker Collection, keep rows that have a marker.
  • Rows: ids 0, 1, 2, all rank 0. Only row 0 has a marker. With one order term the fixture rank is rank * 100 + id, so the order is 2, 1, 0.

Expected window: [0]. Actual window: [] (expected [] to deeply equal [ +0 ]).

Cause (from the oracle's notes, not yet traced in detail)

The loader repeats a continuation offset that it caps at the window size. The offset-only provider then answers the same rows again, and the loader never reaches row 0.

Scope

This reproduces on main. It is separate from #2136. The query-db refetch oracle's generated campaigns use a cursor provider only, because of this defect.

Suggested witness and owner

  • Owner: the ordered loader (packages/db/src/query/live/ordered-source-loader.ts). Read ARCHITECTURE.md "Ordered requests, continuation, and recovery" first.
  • Witness: flip the pinned it.fails test to a normal test. Then let the query-db refetch oracle's generated scenario choose encoding: offset too.

This issue was written by Isaac.

Lingua principale
TypeScript
Stelle
4k
Fork
277
Merge medio
18h 49m
PR unite (30g)
224

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di TanStack/db

Tutte le issue di TanStack/db

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.