mirror of
https://github.com/dergigi/boris.git
synced 2026-01-17 05:44:24 +01:00
fix: move lastLoadedPubkey assignment to end of start() method
The bug: start() was setting lastLoadedPubkey at the beginning, so if start() got called twice (which it was), the second call would see isLoadedFor(pubkey) return true and skip the entire loading process, including fetching mark-as-read reactions. Fix: Only set lastLoadedPubkey AFTER all fetching is complete. This ensures that concurrent start() calls don't skip the loading. This allows kind:7 and kind:17 mark-as-read reactions to be fetched and tracked properly.
This commit is contained in:
@@ -186,7 +186,6 @@ class ReadingProgressController {
|
||||
}
|
||||
|
||||
this.setLoading(true)
|
||||
this.lastLoadedPubkey = pubkey
|
||||
|
||||
try {
|
||||
// Seed from local cache immediately (survives refresh/flight mode)
|
||||
@@ -333,6 +332,9 @@ class ReadingProgressController {
|
||||
console.log('[readingProgress] Final markedAsReadIds:', Array.from(this.markedAsReadIds))
|
||||
}
|
||||
}
|
||||
|
||||
// Mark as loaded AFTER everything is fetched
|
||||
this.lastLoadedPubkey = pubkey
|
||||
} catch (err) {
|
||||
console.error('📊 [ReadingProgress] Failed to load:', err)
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user