fix: return synchronous API responses directly - #1337
Conversation
✅ Deploy Preview for poetic-froyo-8baba7 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthrough
Estimated code review effort: 2 (Simple) | ~10 minutes Mergeability Score: ⚪ Minimal · up to This localized change makes synchronous API calls return successful dictionary and None responses directly, with regression coverage for both cases; no actionable merge-blocking risk remains after normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
All Submissions:
devbranch.Changes to Core Features:
Summary
Fixes #1336.
ApiClient.request_sync()previously passed the result of the synchronousApiClient.request()toasyncio.run_until_complete(). Successful dictionary responses andNoneresponses were therefore rejected withTypeErrorbecause they are not awaitable.The synchronous wrapper now directly returns
self.request(...).AsyncApiClient.request_sync()is intentionally unchanged because itsrequest()method is a coroutine and still needs the event-loop bridge.Validation
type_=Noneresponses: 2 passedgit diff --checkAI assistance was used to reproduce the sync/async drift, review edge cases, and draft tests; every changed line and test result was manually verified.