Bundle bindings route repeats full-state parsing and full re-hashing on every request
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 48/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- typescript
- Área
- backend, performance
Línea de trabajo
Start with reference-implementations/dacs-directory/app/api/dacs/bundles/[jobId]/route.ts, then read src/catalog/pagination.ts and test/catalog-binding-pagination.test.ts to understand the current page and cursor behavior. The issue calls for a per-job binding index or cache that avoids loading all scan state and re-hashing and sorting bindings on each page. Update the cost notes in README.md and src/catalog/contracts.ts; done means the existing cursor behavior is preserved and the pagination tests pass.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Where: reference-implementations/dacs-directory/app/api/dacs/bundles/[jobId]/route.ts:33 (on phase0-completion at the linked commit)
What goes wrong: Every GET /api/dacs/bundles/{jobId} calls loadScanState() (route.ts:33), which reads, parses and normalises the entire stored scan state only to look up one jobId, so the cost grows with the size of the whole state rather than the reply. In addition, every request with limit or cursor (route.ts:37) computes the content hash of every binding stored for the job and sorts them all in keysetPage (src/catalog/pagination.ts), then returns one page, so reading a large job in pages repeats that work on each page. The README (README.md:366-367) and the OpenAPI descriptions (src/catalog/contracts.ts:404-405) already warn that paged reads cost more than a plain read.
Suggested fix: Stop loading the full scan state per request: read only the bundle bindings, for example from a small separately stored or cached index keyed by jobId. Keep each job's bindings in content-hash order in that index (or cache the hash-ordered list per job) so a page is a slice instead of a full re-hash and sort. Keep the existing cursor behaviour (a page starts after the cursor key even if that binding is gone) and its tests in test/catalog-binding-pagination.test.ts. Then update the cost note in README.md:366-367 and src/catalog/contracts.ts:404-405 to match.
Size: Medium
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
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de DACS-Agent-commerce/Community
-
Payment safety page: explain 'preimage' and 'claim' and name the cross-chain open state preciselyAbiertocontributors-section
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
DACS-Agent-commerce/Community#366 ·
Los mantenedores suelen responder en 1 día
-
contributors-section
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
DACS-Agent-commerce/Community#361 ·
Los mantenedores suelen responder en 1 día
-
contributors-section
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
DACS-Agent-commerce/Community#359 ·
Los mantenedores suelen responder en 1 día
-
contributors-section
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
DACS-Agent-commerce/Community#354 ·
Los mantenedores suelen responder en 1 día
-
OpenAPI entry for the listing version route omits its 409 responsePosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertocontributors-section
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
DACS-Agent-commerce/Community#348 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de DACS-Agent-commerce/Community
Issues similares
-
Diagram: Gantt qa-manually-tested Type: Bug / Error
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
mermaid-js/mermaid-v13#1255 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
Name Option For /gifAbiertoenhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
BaseAdresseNationale/adresse.data.gouv.fr#2620 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día