Skip to content

Conversation

@bilby91
Copy link

@bilby91 bilby91 commented Dec 19, 2025

SSE client calls were using raw opts.body instead of properly serialized body data, causing SSE requests with JSON bodies to send malformed data. Now correctly passes serializedBody (via getValidRequestBody) to createSseClient across all affected client adapters (fetch, angular, axios, ky, next, nuxt).

@bolt-new-by-stackblitz
Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@vercel
Copy link

vercel bot commented Dec 19, 2025

@bilby91 is attempting to deploy a commit to the Hey API Team on Vercel.

A member of the Team first needs to authorize it.

@changeset-bot
Copy link

changeset-bot bot commented Dec 19, 2025

🦋 Changeset detected

Latest commit: 6505659

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

This PR includes changesets to release 1 package
Name Type
@hey-api/openapi-ts Minor

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

@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. bug 🔥 Broken or incorrect behavior. labels Dec 19, 2025
@bilby91 bilby91 force-pushed the fix/sse-body-serialization branch from cc699b0 to 393de79 Compare December 19, 2025 19:43
@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. and removed size:XS This PR changes 0-9 lines, ignoring generated files. labels Dec 19, 2025
@bilby91 bilby91 force-pushed the fix/sse-body-serialization branch from 393de79 to ad2e7b2 Compare December 19, 2025 20:08
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels Dec 19, 2025
@bilby91 bilby91 force-pushed the fix/sse-body-serialization branch from ad2e7b2 to 6ab9677 Compare December 20, 2025 00:02
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Dec 20, 2025
@codecov
Copy link

codecov bot commented Dec 20, 2025

Codecov Report

❌ Patch coverage is 14.28571% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 33.39%. Comparing base (85b9071) to head (6505659).
⚠️ Report is 14 commits behind head on main.

Files with missing lines Patch % Lines
...c/plugins/@hey-api/client-angular/bundle/client.ts 0.00% 1 Missing ⚠️
...src/plugins/@hey-api/client-axios/bundle/client.ts 0.00% 1 Missing ⚠️
...src/plugins/@hey-api/client-fetch/bundle/client.ts 0.00% 1 Missing ⚠️
...ts/src/plugins/@hey-api/client-ky/bundle/client.ts 0.00% 1 Missing ⚠️
.../src/plugins/@hey-api/client-next/bundle/client.ts 0.00% 1 Missing ⚠️
.../src/plugins/@hey-api/client-nuxt/bundle/client.ts 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3123      +/-   ##
==========================================
- Coverage   33.44%   33.39%   -0.06%     
==========================================
  Files         429      429              
  Lines       33599    33661      +62     
  Branches     2156     2156              
==========================================
+ Hits        11238    11240       +2     
- Misses      22333    22393      +60     
  Partials       28       28              
Flag Coverage Δ
unittests 33.39% <14.28%> (-0.06%) ⬇️

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.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 20, 2025

Open in StackBlitz

npm i https://pkg.pr.new/hey-api/openapi-ts/@hey-api/codegen-core@3123
npm i https://pkg.pr.new/hey-api/openapi-ts/@hey-api/nuxt@3123
npm i https://pkg.pr.new/hey-api/openapi-ts/@hey-api/openapi-ts@3123
npm i https://pkg.pr.new/hey-api/openapi-ts/@hey-api/vite-plugin@3123

commit: 6505659

@mrlubos
Copy link
Member

mrlubos commented Dec 20, 2025

@bilby91 hey! Would you be able to add a unit test to capture the behavior? Snapshots are good for capturing generated output, unit tests would be helpful for seeing what it actually does

@bilby91
Copy link
Author

bilby91 commented Dec 20, 2025

Yep. I'll take care of this. Thanks for taking the time to review.

@mrlubos
Copy link
Member

mrlubos commented Dec 20, 2025

Thank YOU for catching these bugs!

SSE client calls were using raw `opts.body` instead of properly serialized body data, causing SSE requests with JSON bodies to send malformed data. Now correctly passes `serializedBody` (via `getValidRequestBody`) to `createSseClient` across all affected client adapters (fetch, angular, axios, ky, next, nuxt).
@bilby91 bilby91 force-pushed the fix/sse-body-serialization branch from 6ab9677 to 6505659 Compare December 20, 2025 17:34
@bilby91
Copy link
Author

bilby91 commented Dec 20, 2025

@mrlubos Added some tests. I think doing it on client-core should be enough right ? If not, let me know!

@bilby91
Copy link
Author

bilby91 commented Dec 25, 2025

Ping @mrlubos

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug 🔥 Broken or incorrect behavior. size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants