diff --git a/additional_tests/supabase_backend_tests/test_storage.py b/additional_tests/supabase_backend_tests/test_storage.py index ab73b3b2f..45f373f13 100644 --- a/additional_tests/supabase_backend_tests/test_storage.py +++ b/additional_tests/supabase_backend_tests/test_storage.py @@ -28,14 +28,22 @@ async def test_upload_asset(admin_client): asset_name = "test_upload_asset" asset_bucket = "product-images" await admin_client.remove_asset(asset_bucket, asset_name) # remove asset if exists - uploaded_asset_id = await admin_client.upload_asset(asset_bucket, asset_name, asset_content) + uploaded_asset_path = await admin_client.upload_asset(asset_bucket, asset_name, asset_content) assets = await admin_client.list_assets(asset_bucket) - asset_by_id = { - asset["id"]: asset + asset_by_name = { + asset["name"]: asset for asset in assets } - assert uploaded_asset_id in asset_by_id - assert asset_by_id[uploaded_asset_id]["name"] == asset_name + assert uploaded_asset_path in asset_by_name + assert asset_by_name[uploaded_asset_path]["name"] == asset_name await admin_client.remove_asset(asset_bucket, asset_name) + + assets = await admin_client.list_assets(asset_bucket) + asset_by_name = { + asset["name"]: asset + for asset in assets + } + # asset is removed + assert uploaded_asset_path not in asset_by_name diff --git a/octobot/community/supabase_backend/community_supabase_client.py b/octobot/community/supabase_backend/community_supabase_client.py index 3e15042f3..fa33ca0ae 100644 --- a/octobot/community/supabase_backend/community_supabase_client.py +++ b/octobot/community/supabase_backend/community_supabase_client.py @@ -862,7 +862,7 @@ async def upload_asset(self, bucket_name: str, asset_name: str, content: typing. Not implemented for authenticated users """ result = await self.storage.from_(bucket_name).upload(asset_name, content) - return result.json()["Id"] + return result.path async def list_assets(self, bucket_name: str) -> list[dict[str, str]]: """ @@ -870,11 +870,11 @@ async def list_assets(self, bucket_name: str) -> list[dict[str, str]]: """ return await self.storage.from_(bucket_name).list() - async def remove_asset(self, bucket_name: str, asset_name: str) -> None: + async def remove_asset(self, bucket_name: str, asset_path: str) -> None: """ Not implemented for authenticated users """ - await self.storage.from_(bucket_name).remove(asset_name) + await self.storage.from_(bucket_name).remove([asset_path]) async def send_signal(self, table, product_id: str, signal: str): return (await self.table(table).insert({ diff --git a/requirements.txt b/requirements.txt index c764d6598..672e74639 100644 --- a/requirements.txt +++ b/requirements.txt @@ -18,14 +18,14 @@ setuptools==69.0.3 # Community websockets -gmqtt==0.6.16 +gmqtt==0.7.0 pgpy==0.6.0 # Error tracking sentry-sdk==2.13.0 # always make sure sentry_aiohttp_transport.py keep working # Supabase ensure supabase_backend_tests keep passing when updating any of those -supabase==2.7.1 # Supabase client +supabase==2.11.0 # Supabase client gotrue # Supabase authenticated API (required by supabase and enforced to allow direct import) postgrest # Supabase posgres calls (required by supabase and enforced to allow direct import) diff --git a/tests/unit_tests/community/test_community_mqtt_feed.py b/tests/unit_tests/community/test_community_mqtt_feed.py index 52e3be0c5..1feb8a371 100644 --- a/tests/unit_tests/community/test_community_mqtt_feed.py +++ b/tests/unit_tests/community/test_community_mqtt_feed.py @@ -69,8 +69,6 @@ async def connected_community_feed(authenticator): finally: if feed is not None: await feed.stop() - if feed._mqtt_client is not None and not feed._mqtt_client._resend_task.done(): - feed._mqtt_client._resend_task.cancel() async def test_start_and_connect(connected_community_feed):