eventstore: fix maxLimit handling when filter.Limit is unset.

This commit is contained in:
fiatjaf
2025-05-12 06:12:58 -03:00
parent 9a0b263ecc
commit 65411a10c8
4 changed files with 3 additions and 5 deletions

View File

@@ -12,8 +12,6 @@ import (
var serialDelete uint32 = 0
func (b *BadgerBackend) DeleteEvent(id nostr.ID) error {
fmt.Println("...", id)
deletionHappened := false
err := b.Update(func(txn *badger.Txn) error {

View File

@@ -28,7 +28,7 @@ func (b *BadgerBackend) QueryEvents(filter nostr.Filter, maxLimit int) iter.Seq[
} else if tlimit < maxLimit {
maxLimit = tlimit
}
if filter.Limit < maxLimit {
if filter.Limit > 0 && filter.Limit < maxLimit {
maxLimit = filter.Limit
}