debug: Add detailed deduplication logging to identify blocking issue

- Add comprehensive logging to show exactly why messages are being blocked
- Log both new and existing message details in deduplication checks
- Show all comparison criteria (content, role, timestamp, ID)
- This will help identify what existing message is causing the duplication block
This commit is contained in:
spencrmartin
2025-11-14 14:30:59 -05:00
parent 5e318a4ce9
commit 756ceb62be
+27 -1
View File
@@ -143,7 +143,33 @@ export default function Pair({
const isVeryRecent = Math.abs(existing.created - msg.created) <= 2;
const isDifferentId = existing.id !== msg.id;
return isSameContent && isSameRole && isVeryRecent && isDifferentId;
const wouldBlock = isSameContent && isSameRole && isVeryRecent && isDifferentId;
if (wouldBlock) {
console.log(`🔍 DEDUP: Found potential duplicate for ${source}:`, {
newMessage: {
id: msg.id,
content: contentText.substring(0, 30) + '...',
role: msg.role,
timestamp: msg.created
},
existingMessage: {
id: existing.id,
content: existingText.substring(0, 30) + '...',
role: existing.role,
timestamp: existing.created
},
checks: {
isSameContent,
isSameRole,
isVeryRecent,
isDifferentId,
timeDiff: Math.abs(existing.created - msg.created)
}
});
}
return wouldBlock;
});
if (recentDuplicate) {