Skip to content

[P1][Review] Accept successful empty 204 responses instead of raising JSONDecodeError #103

Description

@karlwaldman

Review-only / approval gate

No implementation, PR merge, package publication or production mutation until the owner approves the full sprint plan.

Evidence

Reviewed main 31b8d80686495c5d6dcac0846d6e5a2c8d4bce8b.

oilpriceapi/client.py request/request_with_headers and async_client.py request parse every 2xx with response.json(). A mocked 204 through client.webhooks.delete('fixture-id') raises JSONDecodeError. The backend v1/webhooks_controller.rb destroy actually returns head :no_content. The deletion can succeed while the caller is told it failed.

Preferred smallest change

Add a narrow no-content response path in the existing transport. Keep delete's documented return contract; do not treat malformed nonempty 200 JSON as success. Remove duplicated decoding only where needed.

Acceptance / negative-path tests

Sync webhook deletion, corresponding async deletion, request_with_headers: 204 empty succeeds without retry; malformed 200 remains an error; 401/403 preserve typed errors. Verify against a disposable fixture, not production deletes.

Risk and PR gate

P1 customer-visible mutation/recovery contract; Saturday.
One focused issue PR; independent adversarial review must challenge deletion safety, public compatibility, failure recovery and whether a smaller deletion suffices. Include red/green test evidence and packed/installable artifact proof for any published SDK/MCP change. Merge only in the approved priority order after reviewer objections are resolved. Do not publish a breaking change as a patch. If already fixed at execution time, record evidence and skip without a cosmetic PR.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions