Conversation
…ions The admin settings sliders weren't working because RLS policies require tenant_id = get_current_tenant_id(). When the database session context wasn't set, upsert operations were silently failing. This fix ensures the tenant context is set via set_tenant_context RPC before both getValue and setValue operations in the AdminSettingsCache.
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughThis change adds tenant-scoped context initialization to the useOptimizedAdminSetting hook. Before executing admin_settings queries and upserts, the code now calls set_tenant_context via RPC to satisfy row-level security checks, with graceful error handling that logs warnings but continues execution. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Free 📒 Files selected for processing (1)
Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login. Comment |
…ions
The admin settings sliders weren't working because RLS policies require tenant_id = get_current_tenant_id(). When the database session context wasn't set, upsert operations were silently failing.
This fix ensures the tenant context is set via set_tenant_context RPC before both getValue and setValue operations in the AdminSettingsCache.
Summary by CodeRabbit
Release Notes
✏️ Tip: You can customize this high-level summary in your review settings.