Scanner assumes every transaction row is an object with a numeric id

Aperta Adatta ai principianti
#341 0 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@cX3po ci sta già lavorando.

Dal 20/11/2026.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
84/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
backend

Direzione di ricerca

Inizia da reference-implementations/dacs-directory/src/catalog/scan.ts:507-521, dove la map e il filtro fresh-row leggono t.id, e confrontalo con objectValue(tx)?.id del backfill dell'ancora alla riga 436. Leggi l'harness di scan esistente in test/scan-robustness.test.ts per vedere come viene pilotato scanChain, poi aggiungi casi di righe null e righe senza id. Fatto significa che le righe senza un id che supera Number.isSafeInteger vengono scartate prima del conteggio e lo scan termina senza lanciare.

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

Descrizione

contributors-section

Where: reference-implementations/dacs-directory/src/catalog/scan.ts:507 (on phase0-completion at the linked commit)

What goes wrong: In the scan loop, page.map((t) => t.id) (scan.ts:507) throws a TypeError if the node returns a null row, and the same happens at the filter on line 514; the whole pass stops. A row with no numeric id passes the 'fresh' filter (typeof t.id !== "number" || ..., scan.ts:514), so it skips the finality-depth check and is counted in scanned and processed (scan.ts:517-521).

Suggested fix: Read ids the way the anchor backfill does (objectValue(tx)?.id, scan.ts:436) and keep only values that pass Number.isSafeInteger. Drop rows without a valid id from the fresh set instead of passing them through. Add a scan test with a null row and an id-less row (test/scan-robustness.test.ts already drives scanChain).

Size: Small

This comes from a code review, not from a failing run, so please confirm it before starting. Send the fix as a pull request to phase0-completion. It merges once tests pass and a maintainer has approved it.

Lingua principale
TypeScript
Stelle
0
Fork
3
Merge medio
20h 26m
PR unite (30g)
119

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 DACS-Agent-commerce/Community

Tutte le issue di DACS-Agent-commerce/Community

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.