Skip to content

Conversation

@seekskyworld
Copy link

@seekskyworld seekskyworld commented Jan 12, 2026

Issue link:

Summary:

  • Handle empty JSON responses by falling back to {} instead of throwing.
  • Apply the fix to v1/v2 generated clients and keep it via the SDK build patch.

Motivation:

  • Some endpoints can return empty bodies, which currently triggers Unexpected end of JSON input in the desktop app.

Validation:

  • bun run typecheck (packages/sdk/js)

@github-actions
Copy link
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions
Copy link
Contributor

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
#7888

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
#7618

PR #7939 - fix: add error handling to RPC system to prevent crashes on session abort
#7939

These may have related error handling improvements in the JSON parsing pipeline that could conflict or overlap with your PR.

@seekskyworld
Copy link
Author

Linked the existing issue in the PR description (Fixes #8014).

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.

Error: Unexpected end of JSON input

1 participant