-
-
Notifications
You must be signed in to change notification settings - Fork 21
Fix async handling in router controller #320
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 async handling in router controller #320
Conversation
Add await keyword before transformResponse call to properly handle the Promise returned by the method. This resolves the issue where the router endpoint returns empty objects instead of the expected content. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
🦋 Changeset detectedLatest commit: 49f7086 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Add await keyword before transformResponse call to properly handle the Promise returned by the method. This resolves the issue where the router endpoint returns empty objects instead of the expected content. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
…rapi-webtools into await-transform
boazpoolman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this fix @cayblood !
I'm wondering how this hasn't come up before 🤔
PS: I've rebased your branch so that we can run the pipeline. If all tests pass I'll merge this.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #320 +/- ##
=======================================
Coverage 39.37% 39.37%
=======================================
Files 2 2
Lines 645 645
Branches 163 163
=======================================
Hits 254 254
Misses 309 309
Partials 82 82
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
• Add await keyword before transformResponse call to properly handle the Promise returned by the method
• Resolves issue where router endpoint returns empty objects instead of expected content
• Fixes
/api/webtools/router?path=...endpoint returning{}when content should be returnedBackground
The
transformResponsemethod returns a Promise, but the code was not awaiting it. This caused the response to be set to an unresolved Promise object, which serializes to{}in the JSON response.Test plan
/api/webtools/router?path=/your-test-pathreturns actual content instead of{}🤖 Generated with Claude Code