Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

<!-- towncrier release notes start -->

## 0.28.13 (2025-10-08)

### Bug fixes

- Fix StreamConsumed error caused by response stream consumption in RetryTransport


## 0.28.12 (2025-09-30)

### Bug fixes
Expand Down
33 changes: 8 additions & 25 deletions port_ocean/helpers/retry.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,20 +352,11 @@ async def _log_response_size_async(
if not self._should_log_response_size(request):
return

# Try to get content length from headers first
content_length = self._get_content_length(response)
if content_length is not None:
size_info = content_length
else:
# If no Content-Length header, try to get actual content size
try:
actual_size = len(await response.aread())
size_info = actual_size
except Exception as e:
cast(logging.Logger, self._logger).error(
f"Error getting response size: {e}"
)
return
if content_length is None:
# If Content-Length is missing, skip logging size to avoid reading the body
return
size_info = content_length

cast(logging.Logger, self._logger).info(
f"Response for {request.method} {request.url} - Size: {size_info} bytes"
Expand All @@ -378,18 +369,10 @@ def _log_response_size(
return

content_length = self._get_content_length(response)
if content_length is not None:
size_info = content_length
else:
# If no Content-Length header, try to get actual content size
try:
actual_size = len(response.read())
size_info = actual_size
except Exception as e:
cast(logging.Logger, self._logger).error(
f"Error getting response size: {e}"
)
return
if content_length is None:
# If Content-Length is missing, skip logging size to avoid reading the body
return
size_info = content_length

cast(logging.Logger, self._logger).info(
f"Response for {request.method} {request.url} - Size: {size_info} bytes"
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "port-ocean"
version = "0.28.12"
version = "0.28.13"
description = "Port Ocean is a CLI tool for managing your Port projects."
readme = "README.md"
homepage = "https://app.getport.io"
Expand Down
Loading