Well-known files route returns a false 503 for non-storage-program anchors

Aperta Adatta ai principianti
#286 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
78/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
node.js, typescript
Ambito
api, backend, testing

Direzione di ricerca

Leggi reference-implementations/dacs-directory/app/api/dacs/wellknown-files/route.ts e src/catalog/chain.ts, poi esamina test/wellknown-files-route.test.ts. Controlla come la route gestisce i locator Anchor che non appartengono al programma di storage rispetto a un risultato assente dal nodo. Aggiungi il caso di listing basato su un fixture e verifica che restituisca un errore non ritentabile, mentre la risposta assente del nodo continua a restituire 503.

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

Descrizione

contributors-section

Where: reference-implementations/dacs-directory/app/api/dacs/wellknown-files/route.ts:38 (on phase0-completion at the linked commit)

What goes wrong: For a listing whose anchor locator is not a stor- plus 40 hex characters address (for example the demo fixture seller), readAnchorResult (src/catalog/chain.ts:79) returns absent without calling the node. The route (route.ts:41-46) then answers 503 with 'the node reports no storage program at the anchor'. No node was asked, so the message is wrong, and 503 invites retries that can never succeed.

Suggested fix: Before the read at route.ts:38, check the locator against ^stor-[0-9a-f]{40}$ (or the anchor kind) and refuse with an accurate, non-retryable error that says the anchor is not a storage-program address, so the index cannot be generated from chain state. Do not use 503 for this case, and keep the existing 503 for an absent answer from the node. Add a test with a fixture-anchored listing to test/wellknown-files-route.test.ts.

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.