bugsnag / bugsnag-python

Official BugSnag error monitoring and error reporting for django, flask, tornado and other python apps.
https://docs.bugsnag.com/platforms/python/
MIT License
84 stars 42 forks source link

Missing clear call in asgi middleware #369

Closed dacevedo12 closed 7 months ago

dacevedo12 commented 7 months ago

Describe the bug

https://github.com/bugsnag/bugsnag-python/blob/master/bugsnag/asgi.py seems to be missing a

finally:
            bugsnag.clear_request_config()

just like its wsgi counterpart

clr182 commented 7 months ago

Hi @dacevedo12

Thanks for reaching out. Have you received any errors/issues relating to this missing finally call? If so could you please elaborate on the error or issue you have seen?

dacevedo12 commented 7 months ago

I was trying to use a callback and get some data from event.request, then I felt curious as to how bugsnag knew which request was active at the time of the error.

Digging in the code I discovered the configure_request call at https://github.com/bugsnag/bugsnag-python/blob/master/bugsnag/asgi.py#L119C9-L119C34 but then I couldn't find the call where it clears it up

clr182 commented 7 months ago

Hi @dacevedo12,

Since the absence of the finally call hasn't resulted in any issues or errors and isn't strictly essential, we won't be incorporating the finally call to clear the request configurations.

Nevertheless, it's important to mention that we welcome pull requests. If you believe there's a valid reason for including this finally call, please don't hesitate to initiate a PR with the suggested change. We'll review it when our priorities allow.