Replaces the per-card view-count transport (each card: list + NIP-45 COUNT +
live sub, × relays — the ~880 REQ/s storm) with ONE shared batched kind-30079
subscription + ONE backfill list() over all visible cards, bucketed back to
per-pointer state by #a. Re-enables the VideoListView circuit-breaker.
Grid counts are convergent/approximate (cheap, persists via the existing view
cache); the watch page opts into an exact NIP-45 COUNT for its single pointer
(modalCoordinator passes { exact: true }) — accurate where it matters, one
request, no storm. Legacy per-pointer path retained for SubscriptionManager-less
environments (tests/mocks).
Verified: nip07-heat steady-idle with views on; flaky multi-relay harness still
all-PASS; new cheat-resistant batching+bucketing test. (Pre-existing
view-counter publish-session-tag failure is unrelated — fails at baseline.)
Co-Authored-By: Claude Opus 4.8 <[email protected]>
- Updated `hydratePointer` in `js/viewCounter.js` to only update local view counts if the network count is strictly greater (or if local state is uninitialized).
- This prevents regressions where a partial or stale network response would overwrite a higher, accurate local count.
- Updated `tests/view-counter.test.mjs` to reflect that fresh view events are additive to the cached high watermark (fixing a test expectation that relied on the old non-monotonic behavior).
- Updated `tests/view-counter.test.mjs` to match `resolveVideoPointer` behavior which prioritizes `dTag` (NIP-33) over `videoRootId`, fixing a legacy test failure.
- Removes the logic in `restoreCacheSnapshot` that deleted cached view counts if they were older than `VIEW_COUNT_CACHE_TTL_MS`.
- Updates `tests/view-counter.test.mjs` to assert that stale cache data is preserved and used as a baseline during hydration, preventing view counts from dropping to zero or lower fallback values during network issues.