mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 16:02:26 +00:00
Merge pull request #1072 from PR0M3TH3AN/refactor-watch-history-context-10244638915022032080
Refactor watch history context to month-centric fields
This commit is contained in:
2 files changed
+6
-3
No files matched your search
@@ -1486,6 +1486,7 @@ class WatchHistoryManager {
|
||||
devLogger.warn("[nostr] Unable to build watch history payload for month.", {
|
||||
actor: actorKey,
|
||||
monthIdentifier,
|
||||
recordId: snapshotId,
|
||||
});
|
||||
return { ok: false, error: "invalid-month", retryable: false };
|
||||
}
|
||||
@@ -1516,7 +1517,7 @@ class WatchHistoryManager {
|
||||
}
|
||||
devLogger.info("[nostr] Preparing to publish watch history snapshot.", {
|
||||
actor: actorKey,
|
||||
snapshotId,
|
||||
recordId: snapshotId,
|
||||
monthIdentifier,
|
||||
itemCount: canonicalItems.length,
|
||||
payloadCount: Array.isArray(payload.items) ? payload.items.length : 0,
|
||||
@@ -1619,7 +1620,7 @@ class WatchHistoryManager {
|
||||
const tryEncryptWithCandidate = async (candidate, plaintext, context = {}) => {
|
||||
const details = {
|
||||
actor: actorKey,
|
||||
snapshotId,
|
||||
recordId: snapshotId,
|
||||
monthIdentifier,
|
||||
payloadSize: plaintext.length,
|
||||
scheme: candidate.scheme,
|
||||
@@ -2401,6 +2402,8 @@ class WatchHistoryManager {
|
||||
const ciphertext = typeof event.content === "string" ? event.content : "";
|
||||
const ciphertextPreview = ciphertext.slice(0, 32);
|
||||
const chunkContext = {
|
||||
recordId: snapshotId,
|
||||
month: snapshotId,
|
||||
eventId: event.id ?? null,
|
||||
};
|
||||
const availableSchemes = Array.from(decryptorCandidates.keys());
|
||||
|
||||
@@ -370,7 +370,7 @@ const BASE_SCHEMAS = {
|
||||
},
|
||||
[NOTE_TYPES.WATCH_HISTORY_CHUNK]: {
|
||||
type: NOTE_TYPES.WATCH_HISTORY_CHUNK,
|
||||
label: "Watch history month payload",
|
||||
label: "Watch history monthly payload",
|
||||
kind: WATCH_HISTORY_KIND,
|
||||
identifierTag: {
|
||||
name: "d",
|
||||
|
||||
Reference in new issue
Block a user