mirror of
https://github.com/dergigi/boris.git
synced 2025-12-24 10:04:19 +01:00
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:
@@ -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 => {
|
||||
|
||||
Reference in New Issue
Block a user