Browse Source

Extend event fetch time window to 5 years (v0.52.7)

- Change default event query window from 30 days to 5 years in web UI
- Remove 6-month fallback retry logic (no longer needed with larger window)
- Simplifies fetchAllEvents function in nostr.js

Files modified:
- app/web/src/nostr.js: Extended time window from 30 days to 5 years
- app/web/dist/bundle.js: Rebuilt with changes
- pkg/version/version: Bump to v0.52.7

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
main v0.52.7
woikos 4 months ago
parent
commit
e75e6de59b
No known key found for this signature in database
  1. 2
      app/web/dist/bundle.js
  2. 2
      app/web/dist/bundle.js.map
  3. 20
      app/web/src/nostr.js
  4. 2
      pkg/version/version

2
app/web/dist/bundle.js vendored

File diff suppressed because one or more lines are too long

2
app/web/dist/bundle.js.map vendored

File diff suppressed because one or more lines are too long

20
app/web/src/nostr.js

@ -951,11 +951,10 @@ export async function fetchAllEvents(options = {}) {
} = options; } = options;
const now = Math.floor(Date.now() / 1000); const now = Math.floor(Date.now() / 1000);
const thirtyDaysAgo = now - (30 * 24 * 60 * 60); const fiveYearsAgo = now - (5 * 365 * 24 * 60 * 60);
const sixMonthsAgo = now - (180 * 24 * 60 * 60);
// Start with 30 days if no since specified // Start with 5 years if no since specified
const initialSince = since || thirtyDaysAgo; const initialSince = since || fiveYearsAgo;
const filters = [{ ...rest }]; const filters = [{ ...rest }];
filters[0].since = initialSince; filters[0].since = initialSince;
@ -964,20 +963,9 @@ export async function fetchAllEvents(options = {}) {
if (kinds) filters[0].kinds = kinds; if (kinds) filters[0].kinds = kinds;
if (limit) filters[0].limit = limit; if (limit) filters[0].limit = limit;
let events = await fetchEvents(filters, { const events = await fetchEvents(filters, {
timeout: 30000
});
// If we got few results and weren't already using a longer window, retry with 6 months
const fewResultsThreshold = Math.min(20, limit / 2);
if (events.length < fewResultsThreshold && initialSince > sixMonthsAgo && !since) {
console.log(`[fetchAllEvents] Only got ${events.length} events, retrying with 6-month window...`);
filters[0].since = sixMonthsAgo;
events = await fetchEvents(filters, {
timeout: 30000 timeout: 30000
}); });
console.log(`[fetchAllEvents] 6-month window returned ${events.length} events`);
}
return events; return events;
} }

2
pkg/version/version

@ -1 +1 @@
v0.52.6 v0.52.7

Loading…
Cancel
Save