From 7d465ba728aab0100567ccbaebc629555f8af144 Mon Sep 17 00:00:00 2001 From: OmShukla-07 Date: Mon, 1 Dec 2025 02:46:22 +0530 Subject: [PATCH 1/2] Fix: Add missing await keyword in authentication dependency and make Weaviate non-blocking --- backend/app/core/dependencies.py | 2 +- backend/main.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/backend/app/core/dependencies.py b/backend/app/core/dependencies.py index a06208dd..59f168a9 100644 --- a/backend/app/core/dependencies.py +++ b/backend/app/core/dependencies.py @@ -47,7 +47,7 @@ async def get_current_user(authorization: str = Header(None)) -> UUID: try: supabase = get_supabase_client() # Verify the token and get user - user_response = supabase.auth.get_user(token) + user_response = await supabase.auth.get_user(token) if not user_response or not user_response.user: raise HTTPException( diff --git a/backend/main.py b/backend/main.py index b7ad80a6..578d015f 100644 --- a/backend/main.py +++ b/backend/main.py @@ -68,8 +68,9 @@ async def test_weaviate_connection(self): if await client.is_ready(): logger.info("Weaviate connection successful and ready") except Exception as e: - logger.error(f"Failed to connect to Weaviate: {e}") - raise + logger.warning(f"Failed to connect to Weaviate during startup: {e}") + logger.warning("Continuing without Weaviate - some features may not work") + # Don't raise - allow backend to start even if Weaviate is unavailable async def stop_background_tasks(self): """Stops all background tasks and connections gracefully.""" From 7de75060009d99fafe05bbbb328d473b0e815b7b Mon Sep 17 00:00:00 2001 From: OmShukla-07 Date: Sat, 3 Jan 2026 19:55:14 +0530 Subject: [PATCH 2/2] Revert Weaviate error handling as requested --- backend/main.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/backend/main.py b/backend/main.py index 578d015f..b7ad80a6 100644 --- a/backend/main.py +++ b/backend/main.py @@ -68,9 +68,8 @@ async def test_weaviate_connection(self): if await client.is_ready(): logger.info("Weaviate connection successful and ready") except Exception as e: - logger.warning(f"Failed to connect to Weaviate during startup: {e}") - logger.warning("Continuing without Weaviate - some features may not work") - # Don't raise - allow backend to start even if Weaviate is unavailable + logger.error(f"Failed to connect to Weaviate: {e}") + raise async def stop_background_tasks(self): """Stops all background tasks and connections gracefully."""