Resolvers return CommonError after side effects, so the client can't tell whether a failed mutation ran
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- graphql, typescript
- Ambito
- api, backend-api-design
Direzione di ricerca
Start by reading the listed resolver and OCR helper files, then inspect packages/client/src/helpers/mutation-dedupe.ts and the hooks using useApiMutation. Trace each listed mutation from its side effects through error handling, and review the related issues #4896 and #4907 for client behavior. Done means the listed mutations communicate reliably whether side effects ran and safe client hooks opt into liftOnCommonError.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Many mutation resolvers wrap their whole body in try { … } catch { return { __typename: 'CommonError', … } }. The catch also covers failures that happen after an irreversible side effect. Examples:
uploadDocument(modules/documents/resolvers/documents.resolver.ts): uploads to Cloudinary ingetDocumentFromFile, then inserts. If the insert fails, the result is aCommonErrorand the file is already uploaded.insertNewBusiness(modules/financial-entities/resolvers/businesses.resolver.ts): inserts the financial entity, then the business.closeDocument(modules/documents/resolvers/documents.resolver.ts): calls Green Invoice, then updates the DB.reprocessDocumentOcr/batchReprocessDocumentsOcr(modules/documents/helpers/reprocess-ocr.helper.ts): a failure after the paid OCR call (e.g. infillDocumentFromOcr) is reported as aCommonError.
Why it matters: the client's duplicate-mutation guard (packages/client/src/helpers/mutation-dedupe.ts, the dedupe option of useApiMutation, added in Urigo/accounter-fullstack#4896 and Urigo/accounter-fullstack#4907) would let the user retry straight away after a clean failure. Because a CommonError might mean "partly done", the guard now always keeps its 20-second window. The opt-in dedupe.liftOnCommonError exists, but no mutation can safely use it yet.
Possible directions:
- Return
CommonErroronly for failures before any side effect (validation, not found), and let later failures surface as GraphQL errors. - Or add a field to
CommonError(e.g.sideEffectsApplied: Boolean). - Or make the side-effecting steps compensate or roll back.
Done when: the mutations above report "nothing ran" in a way the client can trust, and the matching client hooks opt into liftOnCommonError where it's safe.
Generated by Claude Code
- Lingua principale
- TypeScript
- Stelle
- 30
- Fork
- 10
- Merge medio
- 2g 12h
- PR unite (30g)
- 276
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
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 Urigo/accounter-fullstack
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
Urigo/accounter-fullstack#5302 ·
I maintainer di solito rispondono entro 2 giorni
-
1214 annual-audit-workflow
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
Urigo/accounter-fullstack#5257 ·
I maintainer di solito rispondono entro 2 giorni
-
1214 annual-audit-workflow
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
Urigo/accounter-fullstack#5256 ·
I maintainer di solito rispondono entro 2 giorni
-
annual-audit-workflow
Difficoltà 1/5 1-3 ore Idoneità per principianti 87/100
Urigo/accounter-fullstack#5252 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
Urigo/accounter-fullstack#4919 ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di Urigo/accounter-fullstack
Issue simili
-
area: integrations documentation priority: P2 size: XS
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
eddiejaoude/StackDash#798 ·
I maintainer di solito rispondono entro 1 giorno
-
bot:ai-assisted component:midnight-js status:untriaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
midnightntwrk/midnight-js#1790 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
area:vscode bug has repro platform:macos platform:vscode regression
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
anthropics/claude-code#113502 ·
-
Add: Rajdhani TV HDApertacheck:passed streams:add
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 77/100
I maintainer di solito rispondono entro 1 giorno