Files
bitvid/tests
thePR0M3TH3ANandClaude Opus 4.8 a3799f3fba fix(watch-history): publish empty month events so clears propagate
Third and final watch-history-delete gap: removing the LAST item of a month (or
clearing all) left the file's items live on relays. updateWatchHistoryList
already sets records[month]=[] to clear an emptied month, but publishMonthRecord
early-returned on an empty month (`if (!items.length) return {ok:true}`), so the
clearing event was never published and relays kept serving the old, full copy.

Now an empty month still publishes a newest, EMPTY replaceable event for that
d-tag, overwriting the old copy so the clear actually takes effect (and reads —
which take the newest per d-tag after fff2bef2 — see it as empty).

Tests + mutation-verified: an emptied month publishes a clearing event with the
right d-tag and no pointer tags, while a month that still has items publishes its
remaining pointers. Restoring the early-return fails the clearing scenario.

Build + full lint green (watchHistory.js under file-size budget).

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-06-20 17:47:21 -04:00
..
2026-02-21 16:08:33 -05:00
2026-02-21 15:53:09 -05:00