we should be doing this since years ago: force an EOSE if the relay refuses to give us one.

This commit is contained in:
fiatjaf
2025-08-25 22:42:05 -03:00
parent db2c1c7653
commit 80d0546ce6
4 changed files with 23 additions and 1 deletions

View File

@@ -6,6 +6,7 @@ import (
"fmt"
"sync"
"sync/atomic"
"time"
)
// Subscription represents a subscription to a relay.
@@ -62,6 +63,10 @@ type SubscriptionOptions struct {
// CheckDuplicateReplaceable is like CheckDuplicate, but runs on replaceable/addressable events
CheckDuplicateReplaceable func(rk ReplaceableKey, ts Timestamp) bool
// a fake EndOfStoredEvents will be dispatched at this time if nothing is received before.
// defaults to 7s (in order to disable, set it to time.Duration(math.MaxInt64))
MaxWaitForEOSE time.Duration
}
func (sub *Subscription) start() {