-
Notifications
You must be signed in to change notification settings - Fork 6.6k
fix: handle empty JSON responses in sdk client #8027
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
base: dev
Are you sure you want to change the base?
fix: handle empty JSON responses in sdk client #8027
Conversation
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
|
The following comment was made by an LLM, it may be inaccurate: Potential Duplicate Found:PR #7888 - fix(sdk): handle empty JSON response bodies gracefully Why it's related: This PR directly addresses the same issue - handling empty JSON response bodies in the SDK client. It appears to be a prior or related attempt to solve the same problem of empty responses causing JSON parsing errors. Related PRs (may have overlapping fixes):PR #7618 - fix(sdk): improve JSON parsing error handling with contextual messages PR #7939 - fix: add error handling to RPC system to prevent crashes on session abort These may have related error handling improvements in the JSON parsing pipeline that could conflict or overlap with your PR. |
|
Linked the existing issue in the PR description (Fixes #8014). |
|
@seekskyworld this will be fixed upstream hey-api/openapi-ts#3202 |
|
ok |
|
@seekskyworld the JSON issue was fixed in v1.1.24, can you try and let me know if this pull request is still needed? |
|
@mrlubos Thanks! I checked v1.1.24 and the v2 SDK now handles empty JSON responses (reads response.text() and parses only |
|
@seekskyworld while it would be nice, I assume they don't maintain v1 anymore as I can't see the build script for it. Let me know if you run into any other issues with OpenCode SDKs! I work on the tooling behind them, so this bug is on me |
|
@mrlubos Thanks, that makes sense! I’ll close this PR. I do have a few other PRs that have been waiting for review—could you |
Issue link:
Summary:
{}instead of throwing.Motivation:
Unexpected end of JSON inputin the desktop app.Validation:
bun run typecheck(packages/sdk/js)