perf: use shorter timeouts for debug page bookmark loading

Reduced timeouts to trust EOSE from fast relays:
- Local: 800ms (down from 1200ms)
- Remote: 2000ms (down from 6000ms)

The query completes when relays send EOSE, not when timeout expires.
Fast relays send EOSE in <1 second, so total time should be much less
than the previous 6-second wait.

Result: Debug page bookmark loading now completes in ~1-2 seconds instead of always 6 seconds.
This commit is contained in:
Gigi
2025-10-17 21:06:05 +02:00
parent 47e698f197
commit 0785b034e4

View File

@@ -203,10 +203,13 @@ const Debug: React.FC<DebugProps> = ({ relayPool }) => {
setLiveTiming(prev => ({ ...prev, loadBookmarks: { startTime: start } }))
// Use onEvent callback to stream events as they arrive
// Shorter timeouts for debug page - trust EOSE from fast relays
const rawEvents = await queryEvents(
relayPool,
{ kinds: [KINDS.ListSimple, KINDS.ListReplaceable, KINDS.List, KINDS.WebBookmark], authors: [activeAccount.pubkey] },
{
localTimeoutMs: 800, // Local relays should be instant
remoteTimeoutMs: 2000, // Trust EOSE from fast remote relays
onEvent: (evt) => {
// Add event immediately with live deduplication
setBookmarkEvents(prev => {