Skip to content

Sentry SDK does not properly adapt async Django middleware #3506

Closed
@Archmonger

Description

@Archmonger

How do you use Sentry?

Self-hosted/on-premise

Version

2.13

Steps to Reproduce

Original issue raised in my repository

  1. Use any standard Django distribution that supports Async (Django >=3.2+)
  2. Install Sentry SDK Middleware
  3. Install ServeStatic Middleware

Expected Result

Sentry SDK should wrap async middleware and forward an async get_response function.

Actual Result

Sentry SDK wraps async middleware but forwards a synchronous get_response function. This breaks any async-only middleware that is being wrapped, including ServeStatic.

The exception output can be seen on the original issue raised by @kefonseca: Archmonger/ServeStatic#25 (comment)

Metadata

Metadata

Labels

Type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions