From 0785b034e47fabf5939bd86fc9418e3368a45688 Mon Sep 17 00:00:00 2001 From: Gigi Date: Fri, 17 Oct 2025 21:06:05 +0200 Subject: [PATCH] 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. --- src/components/Debug.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/Debug.tsx b/src/components/Debug.tsx index 5f840aec..6d1f9760 100644 --- a/src/components/Debug.tsx +++ b/src/components/Debug.tsx @@ -203,10 +203,13 @@ const Debug: React.FC = ({ 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 => {