mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 16:02:26 +00:00
Triaged the monolithic tests/view-counter.test.mjs and got the whole file green, then removed it from the QUARANTINE map: - Pinned nostrClient.getSubscriptionManager() to null so the test exercises the legacy per-pointer hydrate/subscribe path it mocks. The batched SubscriptionManager path (added with the relay-storm work) was silently shadowing the mocked legacy APIs. - Made the dedupe-window test bucket-aligned (it used Date.now(), so the +window/2 offset could straddle a fixed-bucket boundary and flake by time of day). - Corrected the hydrateVideoHistory root-timestamp assertions to the refactored unit boundary: hydrateVideoHistory populates the rootCreatedAtByRoot MAP; the video object's rootCreatedAt FIELD is applied by syncActiveVideoRootTimestamp. reactionCounter.js audit (kind-7 likes): accurate, no fix needed. It does not use NIP-45 COUNT; it lists kind-7 events and dedupes via applyReactionToState keyed by pubkey (one reaction per user, latest-wins) with per-content totals — no raw-count inflation. Kind-7 isn't replaceable, so listing+dedupe is the only accurate model. Spec corrections documented in TEST_INTEGRITY.md (SCN-view-counter-legacy-path, SCN-hydrate-root-timestamp). Co-Authored-By: Claude Opus 4.8 <[email protected]>