Files
orangecat/scripts/test/debug-user-id.js
T
Your Name 38cc4669d8 chore: comprehensive codebase cleanup and organization
- Move 100+ files from root to proper directories
  - Migration scripts → scripts/db/
  - SQL files → supabase/sql/archive/
  - Test/debug scripts → scripts/test/
  - Documentation → docs/archive/ (organized by category)
  - Shell scripts → scripts/ (organized by category)

- Fix test organization
  - Remove nested tests/unit/tests/unit/ structure
  - Consolidate test files to proper locations

- Update documentation references
  - Update migration script paths in workflow docs
  - Update scripts/README.md with moved file notes

- Delete placeholder files
  - Remove empty placeholder.ipynb

- Result: Root directory now contains only essential config files
- Result: Professional, organized codebase structure
- Result: All files in proper locations per project standards

See docs/CLEANUP_COMPLETE.md for full details.
2025-12-21 22:57:54 +01:00

81 lines
1.5 KiB
JavaScript

const { createClient } = require('@supabase/supabase-js');
const supabase = createClient(
process.env.NEXT_PUBLIC_SUPABASE_URL,
process.env.SUPABASE_SERVICE_ROLE_KEY
);
async function debugUser() {
try {
console.log('Debugging user ID...');
// Get mao's profile
const { data: maoProfile, error: profileError } = await supabase
.from('profiles')
.select('*')
.eq('username', 'mao')
.single();
if (profileError) {
console.error('Error fetching mao profile:', profileError);
return;
}
console.log('Mao profile:', maoProfile);
// Check conversation participants for a specific conversation
const conversationId = '39084687-d46f-48ca-a577-1fa0c1d4d7e2'; // One of the conversations
const { data: participants, error: partError } = await supabase
.from('conversation_participants')
.select('*')
.eq('conversation_id', conversationId);
if (partError) {
console.error('Error fetching participants:', partError);
return;
}
console.log('Participants in conversation:', participants);
// Check if mao is in the participants
const maoParticipant = participants.find(p => p.user_id === maoProfile.id);
console.log('Mao is participant:', !!maoParticipant);
if (maoParticipant) {
console.log('Mao participant details:', maoParticipant);
}
} catch (error) {
console.error('Debug error:', error);
}
}
debugUser();