Hacktoberfest 2026 : les issues que les mainteneurs ont marquées pour octobre, ouvertes et accessibles aux débutants. Parcourir les issues Hacktoberfest

Ordered window starts two full-source reads after a signalling refetch with a NaN boundary

Ouverte
#2,221 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
1-2 jours
Accessibilité débutants
48/100
Type d'issue
Bug
Clarté
Plutôt claire
Activité
Active
Stack technique
typescript
Domaine
database, testing

Piste de recherche

Read ARCHITECTURE.md alongside the ordered-work oracle at packages/db/tests/query/ordered-work-oracle.property.test.ts, then reproduce the reported seed with the oracle and config from #2194 using the provided Vitest command. Trace why this counterexample starts two full-source reads after a signalling refetch and decide, according to ARCHITECTURE.md, whether the law or loader should change; done when the chosen behavior is justified and the reported assertion passes.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

Summary

An ordered live query issues two full-source reads after one signalling refetch. The law in the ordered-work oracle allows one. The window is descending with nulls: first, an anti-joined marker filters it, and one source row has a NaN rank, so the bounded boundary cannot be expressed.

The failure is on main. #2194 does not cause it. It changes the oracle's generator, so the seed reproduces only with the oracle file from #2194.

Law

The ordered-work oracle (packages/db/tests/query/ordered-work-oracle.property.test.ts) checks this rule: after a signalling refetch, the loader starts at most one full-source request. #2194 makes the law skip a bounded read that ends on a null or NaN rank, because ARCHITECTURE.md sends that boundary to the full-source fallback. Here the loader starts two full-source requests, not one.

Reproduce

  1. Check out main (tested at 501b4813c).
  2. Copy packages/db/tests/query/ordered-work-oracle.property.test.ts and packages/db/tests/oracle-config.ts from the ordered-loader-ledger branch (#2194).
  3. From packages/db, run:
TANSTACK_DB_ORACLE_SEED=-1142653059 npx vitest run --coverage.enabled=false \
  tests/query/ordered-work-oracle.property.test.ts \
  -t "keeps rows and per-change work bounded"

Result:

AssertionError: full-source requests after a signalling refetch at step 2: expected 2 to be 1

Counterexample:

{"path":"on-demand","provider":"refetch-signal","latency":"immediate","cancellation":"cooperative","peer":false,"filter":"anti-joined","via":"marker","indexed":false,"direction":"desc","nulls":"first","terms":1,"limit":2,"offset":0,"initial":[{"id":0,"rank":0,"eligible":true},{"id":2,"rank":NaN,"eligible":true},{"id":1,"rank":0,"eligible":false}],"history":[{"type":"delete-visible"},{"type":"move","offset":0,"limit":1}]}

Open question

The cause is not known yet. There are two possible causes:

  • The exemption in the law is too narrow for a NaN rank at the start of a descending, nulls: first order.
  • The loader starts a second full-source read that it does not need.

A fix must decide which one, with ARCHITECTURE.md as the authority, before it changes the law or the loader.

This issue was written by Isaac.

Langage dominant
TypeScript
Étoiles
4k
Forks
277
Merge moyen
17 h 33 min
PR mergées (30 j)
227

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de TanStack/db

Toutes les issues de TanStack/db

Issues similaires

Plus d'issues TypeScript

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.