![]() Server : Apache/2 System : Linux server-15-235-50-60 5.15.0-164-generic #174-Ubuntu SMP Fri Nov 14 20:25:16 UTC 2025 x86_64 User : gositeme ( 1004) PHP Version : 8.2.29 Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname Directory : /home/gositeme/domains/lavocat.ca/private_html/scripts/ |
const { PrismaClient } = require('@prisma/client');
const prisma = new PrismaClient();
async function checkUsers() {
try {
console.log('=== CHECKING DATABASE USERS ===');
const users = await prisma.users.findMany({
select: {
id: true,
name: true,
email: true,
role: true
}
});
console.log(`Found ${users.length} users in database:`);
console.log('');
users.forEach((user, index) => {
console.log(`${index + 1}. User ID: ${user.id}`);
console.log(` Name: ${user.name}`);
console.log(` Email: ${user.email}`);
console.log(` Role: ${user.role}`);
console.log('');
});
// Check if the specific user ID from logs exists
const problematicUserId = 'cmc6lkewu0000vj0c0v3s7otj';
const foundUser = users.find(user => user.id === problematicUserId);
console.log('=== ANALYZING LOGS ===');
console.log(`Looking for user ID from logs: ${problematicUserId}`);
if (foundUser) {
console.log(`✅ User found in database:`);
console.log(` Name: ${foundUser.name}`);
console.log(` Email: ${foundUser.email}`);
console.log(` This user should be reachable for video calls`);
} else {
console.log(`❌ User NOT found in database`);
console.log(` This explains why video calls show "recipient offline"`);
console.log(` The user ID in the logs might be outdated or incorrect`);
}
console.log('');
console.log('=== RECOMMENDATIONS ===');
if (!foundUser) {
console.log('1. Check if users are logging in with the correct credentials');
console.log('2. Verify WebSocket authentication is working properly');
console.log('3. Check if user sessions are being maintained correctly');
console.log('4. Clear browser cache and re-login');
} else {
console.log('1. Check WebSocket connection mapping on server');
console.log('2. Verify user presence tracking');
console.log('3. Check if multiple browser tabs are causing issues');
}
} catch (error) {
console.error('❌ Error checking users:', error);
} finally {
await prisma.$disconnect();
}
}
checkUsers().catch(console.error);