🐛 fix: accept any 2xx in _request, tolerate empty bodies on writes #197
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/accept-2xx"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
_requeststops treating 200 as the only success; write paths stop assuming a parseable body:Evidence
ComwattAPIErrordespite success (_core.py:96-97); even with 2xx accepted,.json()on a 204 body would have traded it for a decode error.After: TDD — 6 failing tests first (201 on read, 201 with body, 204 empty body ×4 endpoints), then the fix.
pytest -q→ 248 passed (+6),mypy→ clean.Merge Danger
Door: two-way
Blast Radius: low — strictly widens the success set; error paths (non-2xx, 401 re-auth) untouched. Actual per-endpoint success codes remain to be live-pinned (follow-up field-notes issue).
Closes #180.
aef08b5c861c264775d0WIP: 🐛 fix: accept any 2xx in _request, tolerate empty bodies on writesto 🐛 fix: accept any 2xx in _request, tolerate empty bodies on writes