mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-01 02:12:26 +00:00
Add dev logging for watch history updates
This commit is contained in:
1 parent
d17047c6ea
commit
d938d01a4c
1 file changed
+29
+29
@@ -2558,6 +2558,35 @@ class NostrClient {
|
||||
this.scheduleWatchHistoryRepublish(normalizedActor, persistedItems);
|
||||
}
|
||||
|
||||
if (isDevMode) {
|
||||
const latestItem = persistedItems[0] || null;
|
||||
const latestPointerKey = pointerKey(latestItem);
|
||||
const latestPointerSummary = latestPointerKey
|
||||
? latestPointerKey.length > 32
|
||||
? `${latestPointerKey.slice(0, 32)}…`
|
||||
: latestPointerKey
|
||||
: null;
|
||||
const actorPreview =
|
||||
normalizedActor.length > 16
|
||||
? `${normalizedActor.slice(0, 8)}…${normalizedActor.slice(-4)}`
|
||||
: normalizedActor;
|
||||
const summary = {
|
||||
actor: actorPreview,
|
||||
itemCount: persistedItems.length,
|
||||
snapshot: snapshotId,
|
||||
latestPointer: latestPointerSummary,
|
||||
latestWatchedAt: Number.isFinite(latestItem?.watchedAt)
|
||||
? new Date(Math.max(0, Math.floor(latestItem.watchedAt))).toISOString()
|
||||
: null,
|
||||
};
|
||||
|
||||
if (overallSuccess) {
|
||||
console.info("[nostr] Watch history snapshot updated:", summary);
|
||||
} else {
|
||||
console.warn("[nostr] Watch history snapshot publish incomplete:", summary);
|
||||
}
|
||||
}
|
||||
|
||||
const pointerEvent =
|
||||
signedIndexEvent ||
|
||||
chunkResults.find((chunk) => chunk.success)?.event ||
|
||||
|
||||
Reference in new issue
Block a user