Repository navigation
fix(match): create the Supabase client on first use - #317
Conversation
Importing the match service no longer crashes the API when SUPABASE_URL or SUPABASE_KEY is missing.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
WalkthroughSupabase client creation now occurs on first use through a cached helper. Both matching functions obtain database access through this helper. Missing required configuration causes an HTTP 503 response. ChangesSupabase access
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Suggested labels: Merge Risk: ⚪ Minimal · up to
|
Link your account with GitcordThanks for opening this PR, @Saahi30! To receive Discord notifications and contributor tracking for this organization:
Once linked, Gitcord can notify you about reviews, merges, and more. — Posted by Gitcord |
Summary
main.pyimports the match router, and that importsBackend/app/services/db_service.py, which built a Supabase client at import time.SUPABASE_URLorSUPABASE_KEYstill killed startup even after the AI routes were fixed.This is separate from #316, which does the same thing for the post routes. Both are needed before the API can import with those variables unset.
Test plan
app.services.db_servicewithSUPABASE_URLandSUPABASE_KEYunset and confirm it does not raise.GET /match/brands-for-creator/{id}with those vars unset and confirm a 503.Summary by CodeRabbit