synapse-sdk: StoreError buries the root cause under repeated wrapper messages
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 72/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- backend-api-design
Direzione di ricerca
Start with packages/synapse-sdk/src/storage/context.ts at StorageContext.store() and packages/synapse-sdk/src/storage/manager.ts where StoreError is built; then read the SynapseError cause handling in packages/synapse-core/src/errors/base.ts. Check the existing message assertions in storage.test.ts and synapse.test.ts. Done means StoreError names the provider once and presents the deepest typed error’s short message and details without repeating wrapper messages.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Follow-up to #841. #1175 makes synapse-core throw InvalidUploadSizeError instead of NetworkError. The SDK still wraps that error twice, and each wrapper copies in the full message of the error directly below it. A consumer such as filecoin-pin that shows StoreError.message gets the real cause, but buried and repeated:
Failed to store piece on service provider 2 (https://calib2.ezpdpz.net)
Details: StorageContext store failed: Failed to store piece on service provider - Invalid upload size.
Details: Size 125 bytes is below minimum allowed size of 127 bytes or exceeds maximum ...
(This output is worked out from the code, not captured from a run.)
Where it comes from
StorageContext.store()wraps the core error withcreateError(). That gives a plainErrorwhose message isStorageContext store failed: Failed to store piece on service provider - <the core error's full message>.StorageManagerwraps that in aStoreErrorwith the same "Failed to store piece on service provider" text.SynapseErrorfills indetailsfromcause.messagewhen no details are given. That copies the whole message from step 1, including the core error's ownDetails:line.
The typed error is still there at error.cause.cause, so code can find it. Only the message is hard to read.
Expected
The StoreError message names the provider once and shows the deepest SynapseError's shortMessage and details:
Failed to store piece on service provider 2 (https://calib2.ezpdpz.net)
Details: Invalid upload size. Size 125 bytes is below minimum allowed size of 127 bytes ...
Possible fixes
These are #841's suggestions 2 and 3:
- In
StorageContext.store(), rethrow aSynapseErrorfrom core unchanged, or wrap it in a typed error that passes on itsdetails, instead of usingcreateError(). - When building
StoreErrordetails, look down thecausechain for the deepestSynapseErrorand use itsshortMessageanddetails, not the message of the error directly below.
Existing tests check the message for 'Failed to store piece on service provider' (storage.test.ts, synapse.test.ts). They should keep passing, or be updated deliberately.
- Lingua principale
- TypeScript
- Stelle
- 27
- Fork
- 36
- Merge medio
- 2g 4h
- PR unite (30g)
- 65
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Nessun 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 FilOzone/synapse-sdk
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
FilOzone/synapse-sdk#1201 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
FilOzone/synapse-sdk#1198 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Clarify add pieces and create set can be made concurrentlyForse già presa @hugomrdias l’ha presa 22 giorni fa. Apertagood first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
FilOzone/synapse-sdk#749 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Upload to restricted data sets with `read: "restricted"`Forse già presa @JAG-UK l’ha presa oggi. Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
FilOzone/synapse-sdk#1197 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Pull second copies from `/download` with per-piece FOC grantsForse già presa @JAG-UK l’ha presa oggi. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
FilOzone/synapse-sdk#1196 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di FilOzone/synapse-sdk
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
zabuton-app/meguri#875 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 86/100
iruzen-dono/workless#117 ·
I maintainer di solito rispondono entro 1 giorno
-
area:api area:web wave wave:trivial
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
vetro-protocol/vetro-monorepo#1321 ·
I maintainer di solito rispondono entro 1 giorno