mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-20 09:11:12 -05:00
1.9 KiB
1.9 KiB
Troubleshooting Guide
Versions Not Being Created
Symptoms: Entity updates don't create versions
Solutions:
- Check if triggers are enabled:
SELECT * FROM pg_trigger WHERE tgname LIKE '%version%'; - Verify session variables are set in edge function
- Check trigger function logs in Supabase dashboard
- Ensure entity table has trigger attached
"Cannot read versions" Error
Symptoms: Frontend can't fetch versions
Solutions:
- Check RLS policies on version tables
- Verify user authentication (is
auth.uid()valid?) - Check entity exists
- Inspect browser console for specific error
Version History Not Showing in UI
Symptoms: Component renders but no versions display
Solutions:
- Verify
useEntityVersionshook is called correctly - Check entity ID is correct
- Inspect network tab for failed queries
- Check if versions exist in database
Rollback Fails
Symptoms: "Permission denied" or rollback doesn't work
Solutions:
- Verify user has moderator role:
SELECT has_role(auth.uid(), 'moderator') - Check target version exists
- Ensure entity hasn't been deleted
- Check MFA requirement (
has_aal2())
Attribution Issues
Symptoms: Versions attributed to moderator instead of submitter
Solutions:
- Verify edge function sets
app.current_user_idtosubmission.user_id - Check session variables before entity update
- Review trigger function logic
Performance Issues
Symptoms: Slow version queries
Solutions:
- Check indexes exist on version tables
- Run
cleanup_old_versions()to reduce table size - Implement pagination for large version lists
- Use
is_current = truefilter when only latest version needed
Need Help?
- Review ARCHITECTURE.md for system design
- Check SCHEMA.md for database structure
- See FRONTEND.md for React integration
- Consult MODERATION.md for workflow issues