Monorepo for Aesthetic.Computer aesthetic.computer
4
fork

Configure Feed

Select the types of activity you want to include in your feed.

at main 40 lines 1.4 kB view raw
1#!/usr/bin/env node 2// Check mood sync status for a user 3 4import { connect } from '../../system/backend/database.mjs'; 5import { userIDFromHandle } from '../../system/backend/authorization.mjs'; 6 7const handle = process.argv[2] || 'jeffrey'; 8 9const database = await connect(); 10const sub = await userIDFromHandle(handle, database); 11const moods = database.db.collection('moods'); 12 13// Get a few recent moods with atproto field 14const recentMoods = await moods.find({ 15 user: sub, 16 'atproto.rkey': { $exists: true } 17}).sort({ when: -1 }).limit(5).toArray(); 18 19console.log(`\n📊 Recent @${handle} moods WITH atproto sync:\n`); 20recentMoods.forEach((mood, i) => { 21 console.log(`[${i+1}] Mood: ${mood.mood.substring(0, 50)}`); 22 console.log(` When: ${mood.when.toISOString()}`); 23 console.log(` MongoDB _id: ${mood._id}`); 24 console.log(` ATProto rkey: ${mood.atproto.rkey}`); 25 console.log(` Full URI: at://${sub}/computer.aesthetic.mood/${mood.atproto.rkey}`); 26 console.log(''); 27}); 28 29// Count synced vs unsynced 30const synced = await moods.countDocuments({ user: sub, 'atproto.rkey': { $exists: true } }); 31const total = await moods.countDocuments({ user: sub, deleted: { $ne: true } }); 32 33console.log(`📈 Sync Status:`); 34console.log(` Total moods: ${total}`); 35console.log(` Synced to ATProto: ${synced}`); 36console.log(` Not synced: ${total - synced}`); 37console.log(''); 38 39await database.disconnect(); 40process.exit(0);