Skip to content

Conversation

@cayblood
Copy link
Contributor

@cayblood cayblood commented Sep 4, 2025

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 returned

Background

The transformResponse method 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

  • Verify that /api/webtools/router?path=/your-test-path returns actual content instead of {}
  • Confirm no regressions in other webtools functionality
  • Test with both authenticated and unauthenticated requests (where appropriate)

🤖 Generated with Claude Code

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-bot
Copy link

changeset-bot bot commented Sep 4, 2025

🦋 Changeset detected

Latest commit: 49f7086

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
strapi-plugin-webtools Patch

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

cayblood and others added 6 commits September 3, 2025 22:55
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]>
Copy link
Member

@boazpoolman boazpoolman left a 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
Copy link

codecov bot commented Sep 4, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 39.37%. Comparing base (324ec80) to head (49f7086).
⚠️ Report is 8 commits behind head on master.

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           
Flag Coverage Δ
unit 39.37% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@boazpoolman boazpoolman merged commit 821ae6c into pluginpal:master Sep 4, 2025
8 checks passed
This was referenced Sep 4, 2025
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.

3 participants