debug: add granular logging to identify where loading hangs

Added logs at each step:
- Setting up timeline subscription
- Timeline subscription ready
- Querying reading progress events
- Got reading progress events count
- Generation changed abort

This will show exactly which step is blocking.
This commit is contained in:
Gigi
2025-10-20 00:23:04 +02:00
parent e8e629f4e1
commit 763f7bef4d

View File

@@ -214,6 +214,7 @@ class ReadingProgressController {
this.timelineSubscription = null
}
console.log('[readingProgress] Setting up timeline subscription...')
const timeline$ = eventStore.timeline({
kinds: [KINDS.ReadingProgress],
authors: [pubkey]
@@ -225,6 +226,7 @@ class ReadingProgressController {
if (!Array.isArray(localEvents) || localEvents.length === 0) return
this.processEvents(localEvents)
})
console.log('[readingProgress] Timeline subscription ready')
// Query events from relays
// Force full sync if map is empty (first load) or if explicitly forced
@@ -240,9 +242,12 @@ class ReadingProgressController {
filter.since = lastSynced
}
console.log('[readingProgress] Querying reading progress events...')
const relayEvents = await queryEvents(relayPool, filter, { relayUrls: RELAYS })
console.log('[readingProgress] Got reading progress events:', relayEvents.length)
if (startGeneration !== this.generation) {
console.log('[readingProgress] Generation changed, aborting')
return
}