Resolvers return CommonError after side effects, so the client can't tell whether a failed mutation ran
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- graphql, typescript
- Domain
- api, backend-api-design
Research direction
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.
Written by the indexing model from the issue text.
Description
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
- Dominant language
- TypeScript
- Stars
- 30
- Forks
- 10
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 276
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Urigo/accounter-fullstack
-
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
Urigo/accounter-fullstack#5302 ·
Maintainers usually reply within 2 days
-
1214 annual-audit-workflow
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Urigo/accounter-fullstack#5257 ·
Maintainers usually reply within 2 days
-
1214 annual-audit-workflow
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Urigo/accounter-fullstack#5256 ·
Maintainers usually reply within 2 days
-
annual-audit-workflow
Difficulty 1/5 1-3 hours Newbie friendliness 87/100
Urigo/accounter-fullstack#5252 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Urigo/accounter-fullstack#4919 ·
Maintainers usually reply within 2 days
All issues in Urigo/accounter-fullstack
Similar issues
-
area: integrations documentation priority: P2 size: XS
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
eddiejaoude/StackDash#798 ·
Maintainers usually reply within 1 day
-
bot:ai-assisted component:midnight-js status:untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
midnightntwrk/midnight-js#1790 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
area:vscode bug has repro platform:macos platform:vscode regression
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
anthropics/claude-code#113502 ·
-
Add: Rajdhani TV HDOpencheck:passed streams:add
Difficulty 1/5 Under an hour Newbie friendliness 77/100
Maintainers usually reply within 1 day