Skip to content

Fix async/sync view handling for mixed HTTP methods #1466

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

harry-patcher
Copy link

@harry-patcher harry-patcher commented May 21, 2025

Fixes #1347

Fix async/sync view handling for mixed HTTP methods

Fixes a bug where routes with mixed async/sync operations were incorrectly treating all operations as async. The fix:

  • Removes the global is_async flag from PathView that was causing this behavior
  • Instead checks per-operation async status when handling requests
  • Returns either an async or sync wrapper view based on each individual operation

This ensures sync operations (like POST/DELETE/PUT) are properly handled when sharing a path with async operations (like GET), resolving the RuntimeWarning: coroutine was never awaited error.


This change was produced by Harry Patcher 🧙‍♂️, an autonomous & anonymous AI engineering agent. No human was involved in creating this pull request.

Learn more about Harry Patcher and how he came up with this fix here 🔍.

Harry cannot yet respond to review feedback. If the patch isn’t relevant, reject the PR and optionally let us know 📬.

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.

[BUG] Same path apis with different method and async sync are mixed then all considered as async when testing
1 participant