Skip to content

Handle empty JSON responses - #52

Merged
ericviana merged 1 commit into
blindpaylabs:mainfrom
samsamtrum:handle-empty-json-responses
Jul 27, 2026
Merged

Handle empty JSON responses#52
ericviana merged 1 commit into
blindpaylabs:mainfrom
samsamtrum:handle-empty-json-responses

Conversation

@samsamtrum

Copy link
Copy Markdown
Contributor

The client currently calls response.json() for every successful response, so empty successful responses fail while parsing the body. This can affect endpoints typed as returning void, such as delete calls.

This change parses the response body as text first and returns null when the body is empty. It also adds a regression test for an empty successful delete response.

@BernardoSM

BernardoSM commented May 31, 2026

Copy link
Copy Markdown
Contributor

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@ericviana
ericviana merged commit c5f11ce into blindpaylabs:main Jul 27, 2026
3 checks passed
ericviana added a commit that referenced this pull request Jul 27, 2026
…#60)

Publish runs on every push to main and unconditionally calls `npm publish`, so any
merge that does not bump the version fails the run with:

  npm error You cannot publish over the previously published versions: 4.0.2.

That just happened twice, on #52 and #58. The noise matters: a permanently red
publish job is how blindpay-cli's genuinely broken publish went unnoticed for two
and a half months and left npm three versions behind.

This adds the same version guard already merged into blindpay-cli and blindpay-mcp,
so an unchanged version is a no-op instead of a failure.

Also tags and creates a GitHub release on publish. This repo has published up to
4.0.2 on npm and has zero git tags, so there is currently no way to see what
shipped in a release from the repo alone.

Two notes, neither addressed here:
- `.changeset/` has around 20 accumulated changeset files and no workflow consumes
  them, so version bumps are effectively manual edits to package.json. Worth either
  wiring up `changeset version` or dropping changesets.
- main currently carries the #52 and #58 fixes at an unbumped 4.0.2, so they are
  unreleased. The next version bump ships them.

Claude-Session: https://claude.ai/code/session_01F1stiNzuNtJXoXtiW9ZCbs
@ericviana

Copy link
Copy Markdown
Member

Thanks for the PR @samsamtrum!

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