Skip to content

Reject empty response batches - #243

Merged
bensynapse merged 1 commit into
mainfrom
fix/reject-empty-response-batches
Oct 8, 2026
Merged

bensynapse merged 1 commit into
mainfrom
fix/reject-empty-response-batches

Conversation

@bensynapse

Copy link
Copy Markdown
Owner

An empty response batch now raises InvalidResponse immediately in parse and parse_json. Both functions previously returned an empty iterator.

JSON-RPC 2.0 section 6 forbids empty response arrays. Non-empty batches keep their lazy iterator.

pytest --cov --cov-report=term-missing passes all 123 tests on Python 3.8.20 and 3.12.3, with 100% line and branch coverage. The four new regression cases fail before the fix.

ruff check ., ruff format --check ., mypy and pyright pass. mkdocs build --strict and all 11 transport and typing example cases pass.

The sdist and wheel build. twine check --strict, check-wheel-contents and the metadata check pass.

  • Tests added or updated
  • CHANGELOG.md updated

@bensynapse
bensynapse merged commit f38b897 into main Oct 8, 2026
12 checks passed
@bensynapse
bensynapse deleted the fix/reject-empty-response-batches branch October 8, 2026 12:02
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.

1 participant