Bundle bindings route repeats full-state parsing and full re-hashing on every request
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- backend, performance
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- TypeScript
- Stelle
- 0
- Fork
- 3
- Merge medio
- 20h 26m
- PR unite (30g)
- 119
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di DACS-Agent-commerce/Community
-
Payment safety page: explain 'preimage' and 'claim' and name the cross-chain open state preciselyApertacontributors-section
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
DACS-Agent-commerce/Community#366 ·
I maintainer di solito rispondono entro 1 giorno
-
contributors-section
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
DACS-Agent-commerce/Community#361 ·
I maintainer di solito rispondono entro 1 giorno
-
contributors-section
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
DACS-Agent-commerce/Community#359 ·
I maintainer di solito rispondono entro 1 giorno
-
contributors-section
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
DACS-Agent-commerce/Community#354 ·
I maintainer di solito rispondono entro 1 giorno
-
OpenAPI entry for the listing version route omits its 409 responseForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertacontributors-section
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
DACS-Agent-commerce/Community#348 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di DACS-Agent-commerce/Community
Issue simili
-
Diagram: Gantt qa-manually-tested Type: Bug / Error
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
mermaid-js/mermaid-v13#1255 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Name Option For /gifApertaenhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
BaseAdresseNationale/adresse.data.gouv.fr#2620 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno