Conversation
`serverFnFetcher` logged every non-`Response` error before rethrowing, including the `AbortError` produced when the caller cancels the request (e.g. TanStack Query aborting a query when its component unmounts). Cancellation is expected control flow, so it is no longer logged; genuine errors are still logged and all errors are still rethrown. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthrough
ChangesServer-function abort handling
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~5 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to Aborted requests avoid expected error-log noise while genuine failures remain visible and all errors are still rethrown. No merge-blocking risk is evident. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| console.log(error) | ||
| // A caller aborting the request is expected control flow, not a failure, so don't log it. | ||
| // We still rethrow so the caller can handle the cancellation. | ||
| if (!isAbortError(error)) { |
There was a problem hiding this comment.
Probably the only test we need is this
| if (!isAbortError(error)) { | |
| if (!(error instanceof Error) || error.name !== 'AbortError') { |
Problem
serverFnFetcher'sgetResponselogs every non-Responseerror before rethrowing:This includes the
AbortErrorthrown when the caller cancels a server-function request, which is normal, expected control flow — not a failure. The most common trigger is TanStack Query aborting a query when its component unmounts: navigating away while a server-fn-backed query is in flight spams the console witheven though nothing is wrong — the request was intentionally cancelled.
Fix
Skip the log when the error is an abort (
DOMExceptionor anyErrorwithname === 'AbortError'). The error is still rethrown, so callers (e.g. TanStack Query) handle the cancellation exactly as before, and genuine errors are still logged.Tests
Added
serverFnFetcherunit tests covering both branches:A changeset is included (
@tanstack/start-client-core,patch).🤖 Generated with Claude Code
Summary by CodeRabbit