Surface watch history publish logs in production

This commit is contained in:
thePR0M3TH3AN committed 2025-10-02 09:49:22 -04:00
1 parent 7149255004
commit e97d1bb084
2 files changed
+29 -33

No files matched your search

+5 -7
View File
@@ -7184,19 +7184,17 @@ class bitvidApp {
(async () => {
try {
const historyResult = await updateWatchHistoryList(thresholdPointer);
if (!historyResult?.ok && isDevMode) {
if (!historyResult?.ok) {
console.warn(
"[playVideoWithFallback] Watch history update failed:",
historyResult
);
}
} catch (historyError) {
if (isDevMode) {
console.warn(
"[playVideoWithFallback] Exception while updating watch history:",
historyError
);
}
console.warn(
"[playVideoWithFallback] Exception while updating watch history:",
historyError
);
}
})().catch((error) => {
if (isDevMode) {
+24 -26
View File
@@ -2558,33 +2558,31 @@ 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,
};
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);
}
if (overallSuccess) {
console.info("[nostr] Watch history snapshot updated:", summary);
} else {
console.warn("[nostr] Watch history snapshot publish incomplete:", summary);
}
const pointerEvent =