From b34b275c8024e6ab28600667986e9c53755607e4 Mon Sep 17 00:00:00 2001 From: Christian Bernard Date: Thu, 5 Jun 2025 14:52:40 -0700 Subject: [PATCH 1/3] Fix issue where aiohttp.ClientResponse data wasn't being awaited on during HTTP exception handling --- openfga_sdk/rest.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/openfga_sdk/rest.py b/openfga_sdk/rest.py index 235523aa..4f4a63e5 100644 --- a/openfga_sdk/rest.py +++ b/openfga_sdk/rest.py @@ -278,6 +278,9 @@ async def handle_response_exception( if 200 <= response.status <= 299: return + if isinstance(response, aiohttp.ClientResponse): + response.data = await response.read() + match response.status: case 400: raise ValidationException(http_resp=response) From a989bddb1afbdbb376f26aba59fde74b181ba51f Mon Sep 17 00:00:00 2001 From: Christian Date: Tue, 24 Jun 2025 14:37:57 -0700 Subject: [PATCH 2/3] Update openfga_sdk/rest.py Code review Co-authored-by: Evan Sims --- openfga_sdk/rest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openfga_sdk/rest.py b/openfga_sdk/rest.py index 4f4a63e5..b72526b6 100644 --- a/openfga_sdk/rest.py +++ b/openfga_sdk/rest.py @@ -278,7 +278,7 @@ async def handle_response_exception( if 200 <= response.status <= 299: return - if isinstance(response, aiohttp.ClientResponse): + if isinstance(response, aiohttp.ClientResponse) and not hasattr(response, "data"): response.data = await response.read() match response.status: From 8ffdfb0620222bbf980096a314ee285513311568 Mon Sep 17 00:00:00 2001 From: Christian Date: Tue, 24 Jun 2025 14:42:23 -0700 Subject: [PATCH 3/3] Update openfga_sdk/rest.py Make the bot happy Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- openfga_sdk/rest.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/openfga_sdk/rest.py b/openfga_sdk/rest.py index b72526b6..01cc9c79 100644 --- a/openfga_sdk/rest.py +++ b/openfga_sdk/rest.py @@ -279,8 +279,7 @@ async def handle_response_exception( return if isinstance(response, aiohttp.ClientResponse) and not hasattr(response, "data"): - response.data = await response.read() - + response.data = await response.read() match response.status: case 400: raise ValidationException(http_resp=response)