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

query-db refetch oracle: a window row is missing from the source Collection after a held delete is released

Ouverte
#2,214 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é
3-5 jours
Accessibilité débutants
48/100
Type d'issue
Bug
Clarté
Clairement spécifiée
Activité
Active
Stack technique
typescript
Domaine
database, testing

Piste de recherche

Start with packages/query-db-collection/tests/refetch-ordered-prefix-oracle.test.ts and run the supplied seed and path using the reproduction command. Trace the held delete, refetch, and release through the query-db code and compare the source Collection with the ordered window after release. Done means the reproduced history satisfies the coverage law, with the relevant tests passing.

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

Description

Summary

The query-db refetch oracle fails on main at bd10e564e for one random seed. The history has a held delete, two upserts, a refetch, and the release of the held delete. After it, a row sorts inside the live window, but the source Collection does not have it.

Reproduction

pnpm install
pnpm --filter @tanstack/db-ivm build
pnpm --filter @tanstack/db build
pnpm --filter @tanstack/db-sqlite-persistence-core build
cd packages/query-db-collection
TANSTACK_DB_ORACLE_SEED=-116668131 \
TANSTACK_DB_ORACLE_PATH="71:3:0:2:1:1:2:3:0:5:5:4:0:0:0:0:3:1:2:4:4:7" \
TANSTACK_DB_ORACLE_PROPERTY=query-db.refetch-ordered-prefix \
npx vitest run tests/refetch-ordered-prefix-oracle.test.ts

The random campaign of query-db.refetch-ordered-prefix found the seed. In my runs, approximately 1 of 3 random campaigns failed.

Shrunk counterexample

{
  "scenario": { "encoding": "cursor", "functionKey": false, "terms": 1, "orderKey": "rank", "limit": 1, "offset": 0 },
  "initial": [
    { "id": 0, "rank": 0, "marked": false },
    { "id": 1, "rank": 0, "marked": false }
  ],
  "history": [
    { "type": "hold", "kind": "delete", "id": 1 },
    { "type": "upsert", "id": 2, "rank": 0 },
    { "type": "upsert", "id": 1, "rank": 1 },
    { "type": "refetch" },
    { "type": "release" }
  ]
}

Failure

coverage after release at step 4: rows [{"id":2,"rank":2,"label":"a2"}] sort at or before the window's end but are [null] in the source Collection

The coverage law applies after the release of the held write. Every row that sorts at or before the end of the served window must then be in the source Collection. Here, row 2 sorts inside the window, but the source Collection does not contain it.

Scope

  • The failure also occurs with the live-query sources of #2194 and of its merge base, so it does not come from #2194.
  • I did not find the cause. The shrunk history has a held delete of row 1 while row 2 is inserted, row 1 moves, and a refetch runs. That points at the refetch and the release of the held write, possibly near #2206.

This issue was written by Isaac.

Langage dominant
TypeScript
Étoiles
3.9k
Forks
277
Merge moyen
18 h 12 min
PR mergées (30 j)
229

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.