Repository navigation
refactor(fastapi): use a global dependency for active thread tracking - #7826
faizansaiyed123 wants to merge 27 commits into
Conversation
ffa6378 to
c428c6e
Compare
|
cursor review |
|
bugbot run verbose=true |
|
Bugbot request id: 8939ba6b-1511-41cb-8bd6-5514646cb90c |
Bugbot rules debugNo rules were used for this review. https://cursor.com/docs/bugbot#team-rules Bugbot request id: 8939ba6b-1511-41cb-8bd6-5514646cb90c |
|
Hey @faizansaiyed123, can you please update your PR now with the current master now that we've merged the thread change? |
1e3d9c2 to
3c15006
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 3c15006. Configure here.
|
@sentrivana Updated the PR with the current master after #7825 was merged. I also addressed the duplicate Starlette patching issue found by Bugbot. Thanks for the guidance! |

Ref #7753
Follow-up to #7825.
This PR replaces FastAPI's private
routing.get_request_handlermonkey patch with an application-level global dependency.Changes:
FastAPI.__init__to register a Sentry global dependency before user-supplied global dependencies.HTTPConnectioninjection so the dependency is safe for FastAPI versions where global dependencies also apply to WebSockets.http.routesetup into the dependency, using FastAPI's effective route context when available.Dependantso synchronous endpoints update thread metadata in their actual worker thread.get_request_handlerpatch.This branch includes #7825 so it can be reviewed end-to-end. Once #7825 is merged, this PR can be rebased/simplified to the dependency-only diff.