🩹 fix: ignore abort signal errors in TRPC client (#9809)

- Add abort error detection in lambda client error handling link
- Prevent showing notifications for aborted requests (e.g., rapid settings updates)
- Check for various abort error patterns: 'aborted', 'AbortError', 'signal is aborted without reason'

Fixes #9401

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: Arvin Xu <arvinxx@users.noreply.github.com>
This commit is contained in:
Arvin Xu
2025-10-21 16:17:18 +08:00
committed by GitHub
parent af33543cba
commit 7f7dcfbff9

View File

@@ -21,10 +21,16 @@ const errorHandlingLink: TRPCLink<LambdaRouter> = () => {
next(op).subscribe({
complete: () => observer.complete(),
error: async (err) => {
// Check if this is an abort error and should be ignored
const isAbortError = err.message.includes('aborted') || err.name === 'AbortError' ||
err.cause?.name === 'AbortError' ||
err.message.includes('signal is aborted without reason');
const showError = (op.context?.showNotification as boolean) ?? true;
const status = err.data?.httpStatus as number;
if (showError) {
// Don't show notifications for abort errors
if (showError && !isAbortError) {
const { loginRequired } = await import('@/components/Error/loginRequiredNotification');
const { fetchErrorNotification } = await import(
'@/components/Error/fetchErrorNotification'