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

Abierto Apto para principiantes
#341 0 comentarios 0 reacciones 1 asignado Ver en GitHub

Los mantenedores suelen responder en 1 día

@cX3po ya está trabajando en esto.

Desde el 20/11/2026.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
84/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
typescript
Área
backend

Línea de trabajo

Empieza en reference-implementations/dacs-directory/src/catalog/scan.ts:507-521, donde el map y el filtro de filas nuevas leen t.id, y compáralo con el objectValue(tx)?.id del backfill de anclas en la línea 436. Lee el harness de scan existente en test/scan-robustness.test.ts para ver cómo se dirige scanChain, y luego añade casos de filas nulas y filas sin id. Hecho significa que las filas sin un id que pase Number.isSafeInteger se descartan antes de contar y el scan termina sin lanzar.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
TypeScript
Estrellas
0
Forks
3
Merge medio
20 h 26 min
PR fusionados (30 d)
119

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de DACS-Agent-commerce/Community

Todos los issues de DACS-Agent-commerce/Community

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.