-
Notifications
You must be signed in to change notification settings - Fork 11
20 Troubleshooting
Vicky Patel edited this page Sep 14, 2026
·
1 revision
Diagnostic guides and resolutions for common setup, database, testing, and build issues in PACT OS.
- #1 Database & Supabase RLS Issues
- #2 Timezone & Day Boundary Behavior
- #3 Local Setup & Dependency Errors
- #4 Next.js Turbopack & Build Errors
- Cause: A Row Level Security (RLS) policy on Table A queries Table B, whose policy in turn queries Table A, creating a circular dependency during policy evaluation.
-
Fix: Avoid cross-table policy queries. Reference
auth.uid()directly or use security-definer helper functions:-- ✅ Recommended RLS Policy Pattern CREATE POLICY "Users can access own data" ON public.tasks FOR ALL USING (auth.uid() = user_id);
-
Cause: User is not authenticated or
auth.uid()does not matchuser_idon target rows. -
Fix: Verify session token via
supabase.auth.getUser(). Inspect RLS policies usingtests/adversarial-rls-audit.sql.
-
Cause: Application clock evaluated in UTC instead of user's localized timezone (
profiles.timezone). -
Fix: Use localized day boundary conversions in
src/lib/time.ts:import { localToUtc, utcToDatetimeLocalInput } from '@/lib/time';
- Cause: Environmental assumption that tests require a cloud database connection.
-
Fix: All 56 domain test suites mock database dependencies locally and run 100% offline. Ensure dependencies are installed via
npm installand run:npm test
- Cause: Windows OS path permission traversal constraints when running Next.js Turbopack in restricted sandbox environments.
-
Fix: Run build commands outside restricted sandboxes or bypass sandbox restrictions:
node node_modules/next/dist/bin/next build
| 🏛️ Project Hub | 🛠️ Developer Docs | 💬 Community & Support |
|---|---|---|
| GitHub Repository | System Architecture | GitHub Discussions |
| Beginner Issue Catalog | Design System | Open Issues |
| Production Deployment | API Reference | Pull Requests |
| Project Roadmap | Testing & QA Matrix | Maintainer Governance |
- Codebase Tour
- Domain Model
- Database Architecture
- Security Model
- Financial System
- Consequence System
- External Integrations
- Discipline Intelligence
- Data Portability & Sync