Skip to content

fix(error-handler): do not report client-aborted requests to Sentry - #12739

Draft
Betree wants to merge 1 commit into
mainfrom
fix/OC-API-898-ignore-client-aborted-requests
Draft

Betree wants to merge 1 commit into
mainfrom
fix/OC-API-898-ignore-client-aborted-requests

Conversation

@Betree

@Betree Betree commented Nov 29, 2026

Copy link
Copy Markdown
Member

Problem

raw-body (behind express.json / express.urlencoded) raises a 400 BadRequestError: request aborted (type: 'request.aborted') when the client closes the connection before the body is fully received (closed tab, navigation, flaky network). It is not actionable and nobody reads the response, but the Express error handler reported it to Sentry as an unknown error.

It used to be ignored in Sentry (OC-API-7JV), but the sentry-javascript v11.15.0 bump (#12611) changed the SDK frames in the stack, so Sentry regrouped it as a new "escalating" issue (OC-API-898).

Change

  • Filter it in code rather than relying on an ignore rule tied to the stack trace: request.aborted errors are no longer sent to Sentry and are logged at info level (with method and URL). The 400 response is unchanged.
  • Tests: aborted requests are not reported; other raw-body errors (e.g. entity.parse.failed) still are.

Notes

  • Not tested locally (package install was not possible in the environment used to write this): please rely on CI. The tests live in a file that also needs the Postgres test database.
  • A similar noise (Request aborted on POST /images, via multer) goes through another path and is not covered here.

Fixes OC-API-898


Generated by Claude Code

`raw-body` (behind `express.json` / `express.urlencoded`) raises a 400
`BadRequestError: request aborted` (`type: 'request.aborted'`) whenever the
client closes the connection before the request body is fully received. This
is not actionable and nobody reads the response, but our Express error handler
reported it to Sentry as an unknown error.

It was already ignored in Sentry as OC-API-7JV (25k+ events), but the
sentry-javascript v11.15.0 bump (#12611) changed the SDK frames of the stack,
so Sentry regrouped it as a new "escalating" issue (OC-API-898). Filter it in
code instead of relying on an ignore rule tied to the stack trace, and log it
at info level.

Fixes OC-API-898

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RGjene6UNw6idtJxr3wH6k
@coderabbitai

coderabbitai Bot commented Nov 29, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

This branch has not been deployed

No deployments
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.

2 participants