From 94eb750854bc0c744deba197e8d7f595cc6b14f1 Mon Sep 17 00:00:00 2001 From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Sat, 4 Oct 2025 17:42:34 -0400 Subject: [PATCH] Fix watch history feed dropping older entries --- js/feedEngine/watchHistoryFeed.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/js/feedEngine/watchHistoryFeed.js b/js/feedEngine/watchHistoryFeed.js index 3b514b37..be7f9f6e 100644 --- a/js/feedEngine/watchHistoryFeed.js +++ b/js/feedEngine/watchHistoryFeed.js @@ -137,19 +137,14 @@ function createWatchHistorySource({ service = watchHistoryService } = {}) { items = []; } - const map = new Map(); + const results = []; for (const raw of Array.isArray(items) ? items : []) { const normalized = normalizeHistoryEntry(raw); - if (!normalized) { - continue; - } - const existing = map.get(normalized.pointerKey); - if (!existing || existing.watchedAt < normalized.watchedAt) { - map.set(normalized.pointerKey, normalized); + if (normalized) { + results.push(normalized); } } - const results = Array.from(map.values()); results.sort((a, b) => { if (a.watchedAt !== b.watchedAt) { return b.watchedAt - a.watchedAt;