From 3c903d0eee085cb81bd5a042ac83eff06db4190f Mon Sep 17 00:00:00 2001 From: Juan Carlos Date: Wed, 3 Jul 2024 16:05:24 -0300 Subject: [PATCH 01/14] Fix #814 --- supabase/_sync/client.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/supabase/_sync/client.py b/supabase/_sync/client.py index c26987d3..47606b52 100644 --- a/supabase/_sync/client.py +++ b/supabase/_sync/client.py @@ -195,6 +195,12 @@ def functions(self): ) return self._functions + def functionTimeout(self, timeout: int): + """Set function timeout""" + if self._functions: + assert timeout > 0, "Timeout must be positive." # No negative timeout. + self._functions._client.timeout = min(int(timeout), 150) # >150 returns HTTP-504. + # async def remove_subscription_helper(resolve): # try: # await self._close_subscription(subscription) From a190aeb3cb891f80bd619b401dbe0c234d397859 Mon Sep 17 00:00:00 2001 From: Juan Carlos Date: Wed, 3 Jul 2024 16:06:01 -0300 Subject: [PATCH 02/14] Fix #814 --- supabase/_async/client.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/supabase/_async/client.py b/supabase/_async/client.py index 79c8eccd..b2b7b5d5 100644 --- a/supabase/_async/client.py +++ b/supabase/_async/client.py @@ -195,6 +195,12 @@ def functions(self): ) return self._functions + def functionTimeout(self, timeout: int): + """Set function timeout""" + if self._functions: + assert timeout > 0, "Timeout must be positive." # No negative timeout. + self._functions._client.timeout = min(int(timeout), 150) # >150 returns HTTP-504. + # async def remove_subscription_helper(resolve): # try: # await self._close_subscription(subscription) From 11403c034300985ca07bbd33784c4d2dd486cae8 Mon Sep 17 00:00:00 2001 From: Juan Carlos Date: Wed, 3 Jul 2024 16:11:42 -0300 Subject: [PATCH 03/14] Fix #814 --- supabase/_sync/client.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/supabase/_sync/client.py b/supabase/_sync/client.py index 47606b52..557751a6 100644 --- a/supabase/_sync/client.py +++ b/supabase/_sync/client.py @@ -199,7 +199,9 @@ def functionTimeout(self, timeout: int): """Set function timeout""" if self._functions: assert timeout > 0, "Timeout must be positive." # No negative timeout. - self._functions._client.timeout = min(int(timeout), 150) # >150 returns HTTP-504. + self._functions._client.timeout = min( + int(timeout), 150 + ) # >150 returns HTTP-504. # async def remove_subscription_helper(resolve): # try: From 1c71791f0b17b397856e58ff34fb55a1c5c64b76 Mon Sep 17 00:00:00 2001 From: Juan Carlos Date: Wed, 3 Jul 2024 16:11:45 -0300 Subject: [PATCH 04/14] Fix #814 --- supabase/_async/client.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/supabase/_async/client.py b/supabase/_async/client.py index b2b7b5d5..65790605 100644 --- a/supabase/_async/client.py +++ b/supabase/_async/client.py @@ -199,7 +199,9 @@ def functionTimeout(self, timeout: int): """Set function timeout""" if self._functions: assert timeout > 0, "Timeout must be positive." # No negative timeout. - self._functions._client.timeout = min(int(timeout), 150) # >150 returns HTTP-504. + self._functions._client.timeout = min( + int(timeout), 150 + ) # >150 returns HTTP-504. # async def remove_subscription_helper(resolve): # try: From f6ad72c06fb58687ac92d023ec1990354e307b13 Mon Sep 17 00:00:00 2001 From: Juan Carlos Date: Fri, 12 Jul 2024 17:56:21 -0300 Subject: [PATCH 05/14] Change implementation, clean out --- supabase/_sync/client.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/supabase/_sync/client.py b/supabase/_sync/client.py index 557751a6..63ee4e09 100644 --- a/supabase/_sync/client.py +++ b/supabase/_sync/client.py @@ -195,13 +195,6 @@ def functions(self): ) return self._functions - def functionTimeout(self, timeout: int): - """Set function timeout""" - if self._functions: - assert timeout > 0, "Timeout must be positive." # No negative timeout. - self._functions._client.timeout = min( - int(timeout), 150 - ) # >150 returns HTTP-504. # async def remove_subscription_helper(resolve): # try: From 775cba8b2e9d98ae4dfa8896677fcf794b3f2317 Mon Sep 17 00:00:00 2001 From: Juan Carlos Date: Fri, 12 Jul 2024 17:56:34 -0300 Subject: [PATCH 06/14] Change implementation, clean out --- supabase/_async/client.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/supabase/_async/client.py b/supabase/_async/client.py index 65790605..88d49eb5 100644 --- a/supabase/_async/client.py +++ b/supabase/_async/client.py @@ -195,13 +195,6 @@ def functions(self): ) return self._functions - def functionTimeout(self, timeout: int): - """Set function timeout""" - if self._functions: - assert timeout > 0, "Timeout must be positive." # No negative timeout. - self._functions._client.timeout = min( - int(timeout), 150 - ) # >150 returns HTTP-504. # async def remove_subscription_helper(resolve): # try: From c258121ea09c8c42d7a067d18b5d5afc66422243 Mon Sep 17 00:00:00 2001 From: Juan Carlos Date: Fri, 12 Jul 2024 17:57:24 -0300 Subject: [PATCH 07/14] Change implementation, clean out --- supabase/_sync/client.py | 1 - 1 file changed, 1 deletion(-) diff --git a/supabase/_sync/client.py b/supabase/_sync/client.py index 63ee4e09..c26987d3 100644 --- a/supabase/_sync/client.py +++ b/supabase/_sync/client.py @@ -195,7 +195,6 @@ def functions(self): ) return self._functions - # async def remove_subscription_helper(resolve): # try: # await self._close_subscription(subscription) From 58b9a52d63e41d92486b451009f170240a3c70bf Mon Sep 17 00:00:00 2001 From: Juan Carlos Date: Fri, 12 Jul 2024 17:57:28 -0300 Subject: [PATCH 08/14] Change implementation, clean out --- supabase/_async/client.py | 1 - 1 file changed, 1 deletion(-) diff --git a/supabase/_async/client.py b/supabase/_async/client.py index 88d49eb5..79c8eccd 100644 --- a/supabase/_async/client.py +++ b/supabase/_async/client.py @@ -195,7 +195,6 @@ def functions(self): ) return self._functions - # async def remove_subscription_helper(resolve): # try: # await self._close_subscription(subscription) From ac17ca76c27132660282620a480b3af30cbf8aec Mon Sep 17 00:00:00 2001 From: Juan Carlos Date: Fri, 12 Jul 2024 18:09:09 -0300 Subject: [PATCH 09/14] Change implementation --- supabase/_sync/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/supabase/_sync/client.py b/supabase/_sync/client.py index c26987d3..0e684974 100644 --- a/supabase/_sync/client.py +++ b/supabase/_sync/client.py @@ -191,7 +191,7 @@ def storage(self): def functions(self): if self._functions is None: self._functions = SyncFunctionsClient( - self.functions_url, self.options.headers + self.functions_url, self.options.headers, self.options.function_client_timeout ) return self._functions From 34322a0fbdb5691d5a7cd1166005f2690237140d Mon Sep 17 00:00:00 2001 From: Juan Carlos Date: Fri, 12 Jul 2024 18:09:25 -0300 Subject: [PATCH 10/14] Change implementation --- supabase/lib/client_options.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/supabase/lib/client_options.py b/supabase/lib/client_options.py index fa75b2ca..d664e7b2 100644 --- a/supabase/lib/client_options.py +++ b/supabase/lib/client_options.py @@ -5,6 +5,7 @@ from httpx import Timeout from postgrest.constants import DEFAULT_POSTGREST_CLIENT_TIMEOUT from storage3.constants import DEFAULT_TIMEOUT as DEFAULT_STORAGE_CLIENT_TIMEOUT +from supafunc.utils import DEFAULT_FUNCTION_CLIENT_TIMEOUT from supabase import __version__ @@ -42,6 +43,9 @@ class ClientOptions: storage_client_timeout: Union[int, float, Timeout] = DEFAULT_STORAGE_CLIENT_TIMEOUT """Timeout passed to the SyncStorageClient instance""" + function_client_timeout: Union[int, float, Timeout] = DEFAULT_FUNCTION_CLIENT_TIMEOUT + """Timeout passed to the SyncFunctionsClient instance.""" + flow_type: AuthFlowType = "implicit" """flow type to use for authentication""" From ae9c5c03ac043b2c603b397596145bfc256e243d Mon Sep 17 00:00:00 2001 From: Juan Carlos Date: Fri, 12 Jul 2024 18:40:46 -0300 Subject: [PATCH 11/14] Fix edge functions timeout --- supabase/_async/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/supabase/_async/client.py b/supabase/_async/client.py index 79c8eccd..efe22b53 100644 --- a/supabase/_async/client.py +++ b/supabase/_async/client.py @@ -191,7 +191,7 @@ def storage(self): def functions(self): if self._functions is None: self._functions = AsyncFunctionsClient( - self.functions_url, self.options.headers + self.functions_url, self.options.headers, self.options.function_client_timeout ) return self._functions From 9a66bdd756620958697d49edbc8f9355c1d10500 Mon Sep 17 00:00:00 2001 From: Juan Carlos Date: Thu, 18 Jul 2024 19:00:50 -0300 Subject: [PATCH 12/14] Fix edge functions timeout --- supabase/lib/client_options.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/supabase/lib/client_options.py b/supabase/lib/client_options.py index d664e7b2..d0191f2c 100644 --- a/supabase/lib/client_options.py +++ b/supabase/lib/client_options.py @@ -43,7 +43,9 @@ class ClientOptions: storage_client_timeout: Union[int, float, Timeout] = DEFAULT_STORAGE_CLIENT_TIMEOUT """Timeout passed to the SyncStorageClient instance""" - function_client_timeout: Union[int, float, Timeout] = DEFAULT_FUNCTION_CLIENT_TIMEOUT + function_client_timeout: Union[int, float, Timeout] = ( + DEFAULT_FUNCTION_CLIENT_TIMEOUT + ) """Timeout passed to the SyncFunctionsClient instance.""" flow_type: AuthFlowType = "implicit" From b97bbd1142e0e3ccc5efa688f60d2f5c507535ef Mon Sep 17 00:00:00 2001 From: Juan Carlos Date: Thu, 18 Jul 2024 19:01:00 -0300 Subject: [PATCH 13/14] Fix edge functions timeout --- supabase/_async/client.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/supabase/_async/client.py b/supabase/_async/client.py index efe22b53..062155de 100644 --- a/supabase/_async/client.py +++ b/supabase/_async/client.py @@ -191,7 +191,9 @@ def storage(self): def functions(self): if self._functions is None: self._functions = AsyncFunctionsClient( - self.functions_url, self.options.headers, self.options.function_client_timeout + self.functions_url, + self.options.headers, + self.options.function_client_timeout, ) return self._functions From 6f0d0ac57132278905d65879d5e566c09e93bbf8 Mon Sep 17 00:00:00 2001 From: Juan Carlos Date: Thu, 18 Jul 2024 19:01:09 -0300 Subject: [PATCH 14/14] Fix edge functions timeout --- supabase/_sync/client.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/supabase/_sync/client.py b/supabase/_sync/client.py index 0e684974..527b030c 100644 --- a/supabase/_sync/client.py +++ b/supabase/_sync/client.py @@ -191,7 +191,9 @@ def storage(self): def functions(self): if self._functions is None: self._functions = SyncFunctionsClient( - self.functions_url, self.options.headers, self.options.function_client_timeout + self.functions_url, + self.options.headers, + self.options.function_client_timeout, ) return self._functions