-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix sql recording for async views #1585
Conversation
It's good to see this. We'd likely need to add a test using an async view to verify this and prevent regressions. |
@tim-schilling yeah, I can do that. Will check even why some tests failed saying that For context, I did that change in strawberry-django-plus to make sql recording work. The only issue other than this one is that I had to disable the Template recorder. Specifically when loading the graphiql template, it triggers a database query to get current user which is not async safe (the issue does not happen if not logged in). |
Hmm, I wonder if we could replace more usages of |
Yes, or even with |
Hrm, interesting... Didn't know about The only moment it could not be used is on python 3.6 or less, since it was released in python 3.7, but it has already reached EOL so it should not be a problem. |
Hey @tim-schilling , just added some tests. Don't know why postgres/postgis tests are failing though |
@matthiask I decided to copy the |
Great! Maybe the relevant utility will be added to Django itself soon. I'm not following the async database work too closely but something is happening there. |
I think this is good unless we also want to switch over the other panels to use ContextVar. |
Hey guys! Just checking if there's anything missing in this PR? |
@matthiask I'm good with this. What do you think? |
Looks good to me. I haven't tested it myself and do not have much experience with async code so I still have some uncertainty, but let's move ahead with this. Thanks @bellini666 and @tim-schilling ! |
No description provided.