Skip to content

docs: correct "swallows" framing for mutationFn throws#116

Merged
desko27 merged 1 commit into
mainfrom
docs/fix-mutation-flow-swallows-wording
Jul 16, 2026
Merged

docs: correct "swallows" framing for mutationFn throws#116
desko27 merged 1 commit into
mainfrom
docs/fix-mutation-flow-swallows-wording

Conversation

@desko27

@desko27 desko27 commented Jul 16, 2026

Copy link
Copy Markdown
Owner

What

The react-call skill (skills/react-call/references/mutation-flow.md) and CONTEXT.md described the useMutationFlow Trigger as "swallowing" a thrown mutationFn. That is wrong.

Why it's wrong

The Trigger chains only .finally()no .catch() (packages/react-call/src/mutation-flow/index.ts:72). This is a deliberate decision recorded in ADR-0016: an uncaught throw from mutationFn escapes as an unhandled promise rejection. The Call stays open on failure because call.end() is never reached (a Stack/lifecycle property), not because the throw is silenced.

Root cause

ADR-0016 reversed the "swallow" framing everywhere it looked — source JSDoc, README, changelog — but its Consequences claimed "CONTEXT.md is unchanged". That was only true of the glossary entries; the example dialogue still said the Trigger "swallows the throw". When the consumer-usage skill was later published (ADR-0021), that residual wording was copied into it.

Changes

  • skills/react-call/references/mutation-flow.md — reframe the passage and teach the pattern: try/catch inside the mutationFn, show your error UI, then return without calling end. No ADR citation (the skill ships to consumers without docs/adr/).
  • CONTEXT.md — fix the example dialogue to the call.end()-grounded explanation.
  • docs/adr/0016-* — dated correction note recording that the example dialogue was the overlooked source of the propagated wording.

Audit

Cross-checked the rest of the skill against source — version (2.0.2 / v2.x), CallContext shape, error strings (No <Root> found!, Multiple instances of <Root> found!), the host API, public exports, and SSR/lazy — all accurate. "swallows" was the only factual defect.

Notes

Docs-only; no changeset (the skill is git-hash versioned per ADR-0021, and neither file ships in the npm package). check:types passes.

The react-call skill and CONTEXT.md described the useMutationFlow Trigger
as "swallowing" a thrown mutationFn. That contradicts the actual code and
ADR-0016: the Trigger chains only `.finally()` (no `.catch()`), so an
uncaught throw escapes as an unhandled promise rejection. The Call stays
open on failure because `call.end()` is never reached, not because the
throw is silenced.

- skills/react-call/references/mutation-flow.md: reframe the passage and
  teach the pattern — try/catch inside the mutationFn, return without end.
- CONTEXT.md: fix the example dialogue (the glossary entries were already
  neutral; the dialogue was the spot ADR-0016 missed).
- ADR-0016: add a dated correction note recording that CONTEXT.md's
  example dialogue was the overlooked source of the propagated wording.
@vercel

vercel Bot commented Jul 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
react-call Ready Ready Preview, Comment Jul 16, 2026 11:40am

@desko27 desko27 merged commit 233b764 into main Jul 16, 2026
8 checks passed
@desko27 desko27 deleted the docs/fix-mutation-flow-swallows-wording branch July 16, 2026 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant