mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-06 12:52:26 +00:00
fix(admin-lists): force full fetch so persisted lastSeen can't hide current list
fetchLatestListEvent fetched admin lists via fetchListIncrementally without an explicit `since`, so it relied on the persisted per-relay lastSeen. Admin lists are replaceable events with a single current version whose created_at does not advance, so once lastSeen == that created_at, every later load queries since=lastSeen+1 and the relay returns nothing — perpetually hiding the current list and dropping admin lists whenever the local cache is absent. Pass since: 0 to force a full fetch of the (tiny) current event each time. Other list callers anchor an explicit since to their own cached state; admin lists have no comparable per-list timestamp, so always re-fetching current is both correct and cheap. Adds tests/nostr/relayBatchFetcherReplaceable.test.mjs documenting the replaceable-event since-gate at the fetcher boundary: relying on persisted lastSeen hides the current event; since: 0 returns it. Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
1 parent
818fe16254
commit
3f19294a8e
2 files changed
+99
No files matched your search
@@ -576,6 +576,11 @@ async function fetchLatestListEvent(filter, contextLabel = "admin-list") {
|
||||
pubkey,
|
||||
dTag,
|
||||
relayUrls: relays,
|
||||
// Force a full fetch: admin lists are replaceable events whose
|
||||
// created_at doesn't advance, so a persisted lastSeen would gate
|
||||
// since=lastSeen+1 and perpetually hide the current event across
|
||||
// reloads. See tests/nostr/relayBatchFetcherReplaceable.test.mjs.
|
||||
since: 0,
|
||||
}),
|
||||
timeoutPromise,
|
||||
]);
|
||||
|
||||
Reference in new issue
Block a user