debug: add detailed logging to understand markedAsReadIds population

Added:
- getMarkedAsReadIds() method to expose markedAsReadIds for debugging
- Final state logging showing all progressMap keys and markedAsReadIds
- Comprehensive logging throughout kind:7/kind:17 processing

This will help identify why markedAsRead articles aren't showing in /me/reads/completed.
Check console logs to see:
1. All progressMap entries (nadrs)
2. All markedAsReadIds entries
3. Step-by-step kind:7 and kind:17 processing
This commit is contained in:
Gigi
2025-10-19 23:51:05 +02:00
parent 569b4357f2
commit 99c164a5e9

View File

@@ -101,6 +101,13 @@ class ReadingProgressController {
return this.markedAsReadIds.has(naddr)
}
/**
* Get all marked as read IDs (for debugging)
*/
getMarkedAsReadIds(): string[] {
return Array.from(this.markedAsReadIds)
}
/**
* Check if reading progress is loaded for a specific pubkey
*/
@@ -326,6 +333,10 @@ class ReadingProgressController {
if (startGeneration === this.generation) {
this.setLoading(false)
}
// Debug: Show what we have
console.log('[readingProgress] === FINAL STATE ===')
console.log('[readingProgress] progressMap keys:', Array.from(this.currentProgressMap.keys()))
console.log('[readingProgress] markedAsReadIds:', Array.from(this.markedAsReadIds))
}
}